SiaNet/Sequential.cs
/// <summary>
/// Backwards the specified grad output.
/// </summary>
/// <param name="gradOutput">The grad output.</param>
Backwards the specified grad output.
Backwards the specified grad output .
private void Backward(Tensor gradOutput)
        {
            var curGradOutput = gradOutput;
            for (int i = Layers.Count - 1; i >= 0; --i)
            {
                var layer = Layers[i];
                layer.Backward(curGradOutput);
                curGradOutput = layer.Input.Grad;
            }
        }
private void Backward ( Tensor gradOutput ) { var curGradOutput = gradOutput ; for ( int i = Layers . Count - 1 ; i >= 0 ; -- i ) { var layer = Layers [ i ] ; layer . Backward ( curGradOutput ) ; curGradOutput = layer . Input . Grad ; } }
Backwards the specified grad output.
Backwards the specified grad output .
gradOutput
Tensor
The grad output.
The grad output .