I want to build a CNN model that takes additional input data besides the image at a certain layer.
To do that, I plan to use a standard CNN model, take one of its last FC layers, concatenate it with the additional input data and add FC layers processing both inputs.
The code I need would be something like:
additional_data_dim = 100 output_classes = 2 model = models.__dict__['inception_v3'] del(model._modules['fc']) # TODO: Concatenate the CNN layer with the additional data model.fc1 = nn.Linear(2048 + additional_data_dim, 2048 + additional_data_dim) model.fc2 = nn.Linear(2048 + additional_data_dim, output_classes)
How should I code that?