Thanks for quick reply!
You are right, I completely forgot about optimizer.zero_grad() although the model is still unstable and can’t fit well. For instance with 100 epoch each time I obtain a bit different results (something like in second picture I posted).
I also run it with 200 epochs, and still can’t get “perfect” result. I would assume that as longer model trains as better the result (exactly in this case!).
Any thought about why the model is unstable and can’t “memorize” the data ?