I tried with and without explicit loss layer. Neither works.
Giulio, you are my hero! Can you please tell me how to extract the parameters for my user-defined "quadratic" layer? I know how to extract weights from a linear layer, but I am not understanding the syntax in general. See file enclosed.