SiaNet/Layers/Activations/PRelu.cs
/// <summary>
/// Calculate the gradient of this layer function
/// </summary>
/// <param name="outputgrad">The calculated output grad from previous layer.</param>
Calculate the gradient of this layer function
Calculate the gradient of this layer function
public override void Backward(Tensor outputgrad)
        {
            pos_relu.Backward(outputgrad);
            neg_relu.Backward(outputgrad);
            Input.Grad = pos_relu.Input.Grad - Params["a"].Data * neg_relu.Input.Grad;
        }
public override void Backward ( Tensor outputgrad ) { pos_relu . Backward ( outputgrad ) ; neg_relu . Backward ( outputgrad ) ; Input . Grad = pos_relu . Input . Grad - Params [ " " ] . Data * neg_relu . Input . Grad ; }
Calculate the gradient of this layer function
Calculate the gradient of this layer function
outputgrad
Tensor
The calculated output grad from previous layer.
The calculated output grad from previous layer .