Leaky rectified linear unit activation: f(x) = x for x > 0 and f(x) = leakySlope * x otherwise. The small negative slope keeps the gradient non zero for negative inputs and avoids dead neurons.
LeakyReluLayer
01 Syntax
Microsoft.VisualBasic.MachineLearning.CNN.layers.LeakyReluLayer
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| .ctor | 2 | Creates a leaky ReLU layer with the default slope of 0.01. |
| forward | 1 | Applies the leaky rectifier element wise. |
| backward | 1 | Backpropagates the gradient, scaling it by leakySlope where the original input was not positive. |
| ToString | 1 | Returns a short description of this layer. |
03 Properties
| Name | Overloads | Summary |
|---|---|---|
| Type | 1 | Gets the kind of this layer, always LayerTypes.LeakyReLU. |
04 Members
#ctor(
Double)Creates a leaky ReLU layer with the given negative slope.
Parameters
| Name | Type | Description |
|---|---|---|
leakySlope | Double | Slope applied to negative inputs. |
#ctor
Creates a leaky ReLU layer with the default slope of 0.01.
forward(DataBlock,
Boolean)Applies the leaky rectifier element wise.
Parameters
| Name | Type | Description |
|---|---|---|
db | DataBlock | The input data block. |
training | Boolean | Ignored; the activation behaves the same in both modes. |
Returns
The activated data block.
backward
Backpropagates the gradient, scaling it by leakySlope where the original input was not positive.
ToString
Returns a short description of this layer.
Returns
The constant text leaky_relu().
Type
Gets the kind of this layer, always LayerTypes.LeakyReLU.