Open yzlyty opened 4 years ago
class channel_selection(nn.Module): def __init__(self, num_channels): super(channel_selection, self).__init__() self.indexes = nn.Parameter(torch.ones(num_channels))
should this be : self.indexes = nn.Parameter(torch.ones(num_channels), requires_grad=False)?
self.indexes = nn.Parameter(torch.ones(num_channels), requires_grad=False)
It would work also. But I think even if we does not set requires_grad=False, then the gradient would still be None. Therefore it does not get updated during back-propogation.
requires_grad=False
should this be :
self.indexes = nn.Parameter(torch.ones(num_channels), requires_grad=False)
?