Hi,
I have a Softmax model, can I calculate the gradients with respect to the input vectors so that I optimize the input vectors and the total loss?
through these steps, the loss is calculated (cross entropy) and the weights and biases are updated
loss = self.criterion(logits, labels) + self.regularizer
loss.backward(retain_graph=True)
self.optimizer.step()
How can I include input vectors in the optimisation process so that the model learns and updates: weights, biases, and input vectors?
Thanks
A