mygrad.operation_base.Operation.backward_var#
- abstract Operation.backward_var(grad: ndarray, index: int, **kwargs) ndarray [source]#
Given
grad = dℒ/df
, computes∂ℒ/∂x_{i}
, wherex_{i}
is one ofx1, ...., xn
.ℒ
is assumed to be the terminal node from whichℒ.backward()
was called.- Parameters:
- gradnumpy.ndarray
The back-propagated total derivative with respect to the present operation: dℒ/df. This will have the same shape as f, the result of the forward pass.
- indexint
The index-location of
var
inself.variables
- Returns:
- numpy.ndarray
∂ℒ/∂x_{i}
- Raises:
- SkipGradient