HI I am new to pytorch.
I use dropout in training, so when I test the data, must I change
to model.eval()? I find I get different accuracy if I don’t add “eval()”
.
lass RNN(nn.Module):
def init(self,):
super(RNN, self).init()
self.lstm = nn.LSTM(input_size, hidden_size, num_layers, batch_first=False, dropout=0.5)
self.keke_drop = nn.Dropout(p=0.5)
self.fc = nn.Linear(hidden_size, num_classes)
Thank you for the help.