Open zorozy opened 4 years ago
don't know if you are still looking for an answer, but here are few steps that you can follow:
torch.save(model.state_dict(), '<file_name>')
new_model.load_state_dict(torch.load('<file_name>'))
as for recording the prediction result of each input (I am assuming you want results for each epoch), you can store those data inside a list:
epoch_data.append([epoch, loss.data.item(), accuracy])
if you want, you can refer to my repository, for further examples/information.
❓ Questions and Help
Description Hi,
I am very new to NLP and would like to ask a very stupid question.
After I trained one NLP model, like GRU, what should I save and how could I reload the model again later on a new test dataset?
Besides, what should I do to record the prediction result for each input in the original sequence?
I am so sorry for this baby question.