mygrad.operation_base.Operation.backward_var#

abstract Operation.backward_var(grad: ndarray, index: int, **kwargs) ndarray[source]#

Given grad = dℒ/df, computes ∂ℒ/∂x_{i}, where x_{i} is one of x1, ...., 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 in self.variables

Returns:
numpy.ndarray

∂ℒ/∂x_{i}

Raises:
SkipGradient