We will create a simple linear model that will map the pre-convoluted features to the respective categories. In this case, the number of categories is two:
class FullyConnectedModel(nn.Module):
def __init__(self,in_size,out_size):
super().__init__()
self.fc = nn.Linear(in_size,out_size)
def forward(self,inp):
out = self.fc(inp)
return out
fc_in_size = 8192
fc = FullyConnectedModel(fc_in_size,classes)
if is_cuda:
fc = fc.cuda()
Now, we are good to train our new model and validate the dataset.