klyn.math.nn.layers.Dropout.backwardTraining
method
public override backwardTraining(context as LayerPass<T>, upstream as NDArray<T>) as LayerGradients<T>
Description

Reuses exactly the keep flags of the corresponding forward pass.

Parameters
ParameterDescription
contextContext generated by this layer.
upstreamSame-shaped output gradient.
Returns

Independent input derivative, or upstream unchanged when rate=0.

Throws
  • ValueException for a foreign context or invalid gradient shape.
Example

dx = dropout.backwardTraining(context, upstream).inputs