Hi all,
I just added the dropout codes in order to avoid the overfitting problem from the basic CNN training codes as follows:
class DropoutFC(nn.Module):
def init(self):
super(DropoutFC, self).init()
self.fc = nn.Linear(100,20)
self.dropout = nn.Dropout(p=0.5)
def forward(self, input):
  out = self.fc(input)
  out = self.dropout(out)
  return out

Net = DropoutFC()
Net.train()
My question is therefore, besides the codes above, if additional codes should be added into the original python file anywhere else?
By the way, the codes to use the class of Train is also shown here:
test_train = Train()
test_train.start_train(epoch=28,batch_display=2000,batch_size=50,save_freq=1)