Solved by albanD in post #2 
              
              
                Hi, 
Your problem is a bit different from the classical neural net as you have one weight per sample that you just try to hardcore over-fit to it. 
In your current code, even though you have a single loss which is the mean, since each element before the mean is computed completely independently from…