- abstract Loss.gradient(predict, target)¶
An abstract method for computing the gradient. Inputs are expected in a shape of
(N, *). Where
Nis a number of samples. Gradient is computed for each sample individually.
- Return type:
An array with gradient values of the shape
(N, *). The output shape depends on the loss function.
QiskitMachineLearningError -- shapes of predict and target do not match.