Show / Hide Table of Contents

Class Relu

Rectified Linear Unit.

With default values, it returns element-wise max(x, 0).

Otherwise, it follows: f(x) = max_value for x >= max_value, f(x) = x for threshold <= x<max_value, f(x) = alpha* (x - threshold) otherwise.

Inheritance
System.Object
BaseLayer
Relu
Inherited Members
BaseLayer.Params
BaseLayer.Input
BaseLayer.Output
BaseLayer.Name
BaseLayer.SkipPred
BaseLayer.Item[String]
BaseLayer.BuildParam(String, Int64[], DataType, BaseInitializer, BaseConstraint, BaseRegularizer, Boolean)
Namespace: SiaNet.Layers.Activations
Assembly: SiaNet.dll
Syntax
public class Relu : BaseLayer

Constructors

| Improve this Doc View Source

Relu()

Initializes a new instance of the Relu class.

Declaration
public Relu()

Methods

| Improve this Doc View Source

Backward(Tensor)

Calculate the gradient of this layer function

Declaration
public override void Backward(Tensor outputgrad)
Parameters
Type Name Description
Tensor outputgrad

The calculated output grad from previous layer.

Overrides
BaseLayer.Backward(Tensor)
| Improve this Doc View Source

Forward(Tensor)

Forwards the inputs and compute the output

Declaration
public override void Forward(Tensor x)
Parameters
Type Name Description
Tensor x

The input tensor for this layer.

Overrides
BaseLayer.Forward(Tensor)

See Also

BaseLayer
  • Improve this Doc
  • View Source
Back to top Generated by DocFX