I have a following neural network architecture:
A(1x16x5x5)---\
-> concat(A,B) (1x32x5x5) --> Conv2D -> classification
B(1x16x5x5)---/
Conv2D=nn.Conv2d(32,16, kernel_size = 1, stride = 1 , padding = 0)
If I want to choose branch A only for testing, then I initialized Conv2d layer like this:
convWeights = np.ones((16,32,1,1))
convWeights[:,16:,:,:] = 0
myNetwork.Conv2.weight = nn.Parameter(torch.from_numpy(convWeights).float().cuda())
myNetwork.Conv2.bias.data.fill_(0)
However, it didn't give the expected classification results. Therefore, I think, I have a problem with the above codes and probably I'm missing something. Shortly, how do I initialize conv2d layer so that it chooses only branch A?