Line 202 :
optimizer = optim.Adam(model.parameters(), lr=0.001)
In practice, I think the effect of Adam is quite bad. When epoch = 10, cost is 1.6; when epoch = 100 or 1000, cost is still equal to 1.6.
So I think we can change Adam to SGD, that is, optimizer = optim.SGD(model.parameters(), lr=0.001)
Line 202 :
optimizer = optim.Adam(model.parameters(), lr=0.001)
In practice, I think the effect of Adam is quite bad. When epoch = 10, cost is 1.6; when epoch = 100 or 1000, cost is still equal to 1.6. So I think we can change Adam to SGD, that is,
optimizer = optim.SGD(model.parameters(), lr=0.001)
Here are the effects of using SGD: