code for saving the model is added

This commit is contained in:
yunjey
2017-03-11 14:54:46 +09:00
parent 278c13513f
commit 86a0872430
17 changed files with 630 additions and 37 deletions

View File

@ -58,4 +58,7 @@ predicted = model(Variable(torch.from_numpy(x_train))).data.numpy()
plt.plot(x_train, y_train, 'ro', label='Original data')
plt.plot(x_train, predicted, label='Fitted line')
plt.legend()
plt.show()
plt.show()
# Save the Model
torch.save(model, 'model.pkl')