Hi everyone!
Model description:
My custom model can be simplified and represented with:
tensors735×390 12.1 KB
These are tensor operations between some constant tensor -in grey- and a vector of  “torch.nn.Parameter(…)”, which contains the terms I want to train by gradient descent.
I created a “nn.Module” child class that implements these tensor operations in the forward method, while the constructor takes care of initialising the constant tensors and the vector of parameters.
Issue:
How can I perform/implement (mini-)batch gradient descent using the model above, considering that the forward method carries out the computations for only one input at the time?
Thank you in advance for helping!