Converting a Variable to a Parameter
(Also notice that I’ve changed batch size to 1, is there a way to do this with bigger batches?) Thanks a lot.
Quilby
apaszke
Thanks a lot apaszke, I was not aware of these “functionals”. Is this the correct way to do this convolution in a batch manner? (it runs very slow…) <SCODE>    y = self.pool(F.relu(self.conv1(y)))
    z = Variable(torch.Tensor(x.size()[0], 16, 10, 10))

    for i in range(x.size()[0]):
        z[i,:]= F.conv2d(y[i,:].unsqueeze(0), x[i,:]).squeeze(0)

    z = self.pool(F.relu(z))
    z = z.view(-1, 16*5*5)
<ECODE> (x contains the convolutional weights, y contains the image I want to convolve over, and z is where I put the result) Thanks
Quilby
Why can’t you compute the convolution with all filters in one go?
apaszke
fmassa
Exactly, that is the point of the dynamic filter network. The conv filters for a certain picture are a function of that picture.
Quilby
You could still separate the convolutions using groups. It’s not going to be super fast, but you could give that a try.
apaszke
The sizes are: Thanks
Quilby
apaszke