Solved by SimonW in post #4 
              
              
                As said above, predict doesn’t have .grad because it is not a parameter, but only an intermediate computation result. The actual parameters of your model will have .grad calculated.
To update the model use these .grad, you would need an optimizer. There are a bunch of options and examples here: htt…