The method calculates the gradient of a loss function with respect to all the weights in the network, so that the gradient is fed to the optimization method which in turn uses it to update the weights, in an attempt to minimize the loss function.
The method calculates the gradient of a loss function with respect to all the weights in the network. This is in an attempt to minimize the loss function. The gradient is fed to the optimization method. This optimization method in turn uses it to update the weights.