public backward(inputs as NDArray<T>, upstream as NDArray<T>) as DenseGradients<T>
Computes exact affine derivatives using the current weights. Call before updating parameters. Batch reduction belongs to the loss; this method sums parameter gradients without averaging a second time.
| Parameter | Description |
|---|---|
inputs | Unmodified inputs used for the corresponding forward pass. |
upstream | Derivative of the loss with respect to outputs [samples, units]. |
Input, weight and bias derivatives; no parameters are updated.
gradients = layer.backward(batch, loss.gradient)