Transpose Convolutions

Поділитися
Вставка
  • Опубліковано 2 гру 2024

КОМЕНТАРІ • 14

  • @yahiaslimani867
    @yahiaslimani867 2 дні тому +1

    very clear thank you

  • @KianaMaillet
    @KianaMaillet 16 днів тому

    very clear! thank you

  • @ittest4451
    @ittest4451 3 дні тому

    why the output is 4*4 ? please explain

  • @debabratagon7289
    @debabratagon7289 10 місяців тому

    How is Transpose Convolutions performed in 2D images with multiple channels?

    • @ankitbhattacharya295
      @ankitbhattacharya295 9 місяців тому +1

      I also have the same doubt...can anybody please elaborate

    • @nirmalbaishnab4910
      @nirmalbaishnab4910 8 місяців тому +1

      consider the given example. say output channel is m and input channel is n. The filter size will be 3x3xm. now we just need to repeat the process described in the video on n input channels. number of parameters will be (3x3xm + 1) x n

  • @swamyyeturu7434
    @swamyyeturu7434 Місяць тому

    Stride 1..?

  • @lidpage
    @lidpage 3 місяці тому +2

    “There’s a mistake, this result isn’t possible. Normally, we should get 3x3 as the output and not 4x4, so his method is at least questionable. It just goes to show that even the great Ng can be wrong.”

    • @GAZ___
      @GAZ___ 3 місяці тому

      What

    • @lidpage
      @lidpage 3 місяці тому

      @@GAZ___ "I had some doubt because the formula for calculating the output of a transposed convolution is as follows:
      𝑂=(𝐼−1)×𝑠 + 𝐾 −2𝑝 = (2-1)*2 + 3 -2*1= 3
      "I thought it wasn’t possible, so I did the calculation with PyTorch and got the same result. The output is a (3,3) ."
      import torch
      from torch import nn
      Input = torch.tensor([[2.0, 1.0], [3.0, 2.0]])
      Kernel = torch.tensor([[1.0, 2.0,1.0], [2.0, 0.0,1.0],[0.0,2.0,1.0]])
      Input = Input.reshape(1, 1, 2, 2)
      Kernel = Kernel.reshape(1, 1, 3, 3)
      Transpose convolution Layer
      Transpose = nn.ConvTranspose2d(in_channels =1,
      out_channels =1,
      kernel_size=3,
      stride = 2,
      padding=1,
      bias=False)

      # Initialize Kernel
      Transpose.weight.data = Kernel
      # Output value
      Transpose(Input)
      tensor([[[[ 0., 4., 0.],
      [10., 7., 6.],
      [ 0., 7., 0.]]]], grad_fn=)
      If I'm wrong, please correct me

    • @5pointpulse-75
      @5pointpulse-75 2 місяці тому

      You are right!

    • @myrthestruver5262
      @myrthestruver5262 2 місяці тому

      he isn't, also don't get why but my professor does it the same.. if anyone gets why lmk:)

    • @zohaib123451
      @zohaib123451 2 місяці тому

      The answer is 4x4 because of the kernel, and the parameters padding and stride. You can also get a 3x3 if you use a 2x2 kernel