suppose I have vgg features of images like 4096 and some other features 2048, so I need to concatenate both together and reduce the feature size to 512. how can I do that?
class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.fc1 = nn.Linear(4096,2048) self.fc2 = nn.Linear(4096,512) def forward(self, f1,f2): x1 = self.fc1(f1) x=torch.cat(x1,f2,1) x = F.relu(self.fc1(x)) return x
and after starting the training process, do we need set feature x before feed the proposed model;
x=Variable(x) ? //(
from torch.autograd import Variable)