Skip to content

The mean of fill_up_weights #41

Open

Description

@UpCoder

Hi, I am reading the code. And I am wondering what's the mean of the function----fill_up_weights.
The code is here.
It seems that use the fill_up_weight to init the parameter of ConvTranspose2d. However, the parameter of ConvTranspose2d maybe not update in the training process. So why do freeze the weight of ConvTranspose2d?

Activity

  1. fyu commented on Jan 22, 2019

    @fyu
    Owner

    The code is for bilinear upsampling. In the early versions of pytorch, upsampling is aligned to the corners, which will actually cause pixel misalignment. Therefore, I made my own version of bilinear upsampling by using "fill_up_weights" and "ConvTranspose2d". It has been resolved in the current pytorch. PyTorch documentation also has some explanation: https://pytorch.org/docs/stable/nn.html?highlight=bilinear#torch.nn.Upsample.

  2. UpCoder commented on Jan 22, 2019

    @UpCoder
    Author

    So, the weight which named as up.weight is useless? In the inference state, could be the ConvTranspose2d operation replaced with the resize operation with the bilinear kernel?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions