Module containing the implementation of the LeCun initialiser
This module implements LeCun initialisation, the precursor to modern initialisation schemes, designed for efficient backpropagation.
Mathematical operation: Uniform variant: W ~ U(-limit, limit) where limit = sqrt(3 / fan_in) Normal variant: W ~ N(0, σ²) where σ = sqrt(1 / fan_in)
fan_in is the number of input units to the layer.
Rationale: Maintains variance of inputs through layers Helps prevent saturation of activation functions
Best for: SELU activation (with lecun_normal variant) Also works with: Tanh, Sigmoid Reference: LeCun et al. (1998), Neural Networks: Tricks of the Trade
Interface for the LeCun normal initialiser
LeCun normal initialiser object
Interface for the LeCun uniform initialiser
LeCun uniform initialiser object
Type for the LeCun initialiser (normal)
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real32), | public | :: | mean | = | 1._real32 |
Scale, mean, and standard deviation of the initialiser |
|
| character(len=20), | public | :: | name |
Name of the initialiser |
|||
| real(kind=real32), | public | :: | scale | = | 1._real32 |
Scale, mean, and standard deviation of the initialiser |
|
| real(kind=real32), | public | :: | std | = | 0.01_real32 |
Scale, mean, and standard deviation of the initialiser |
| private module function initialiser_lecun_normal_setup () | Interface for the LeCun normal initialiser |
| procedure, public, pass(this) :: initialise => lecun_normal_initialise | Initialise the weights and biases using the LeCun normal distribution |
Type for the LeCun initialiser (uniform)
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real32), | public | :: | mean | = | 1._real32 |
Scale, mean, and standard deviation of the initialiser |
|
| character(len=20), | public | :: | name |
Name of the initialiser |
|||
| real(kind=real32), | public | :: | scale | = | 1._real32 |
Scale, mean, and standard deviation of the initialiser |
|
| real(kind=real32), | public | :: | std | = | 0.01_real32 |
Scale, mean, and standard deviation of the initialiser |
| private module function initialiser_lecun_uniform_setup () | Interface for the LeCun uniform initialiser |
| procedure, public, pass(this) :: initialise => lecun_uniform_initialise | Initialise the weights and biases using the LeCun uniform distribution |
Interface for the LeCun normal initialiser
LeCun normal initialiser object
Interface for the LeCun uniform initialiser
LeCun uniform initialiser object
Initialise the weights and biases using the LeCun normal distribution
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lecun_normal_init_type), | intent(inout) | :: | this |
Instance of the LeCun initialiser |
||
| real(kind=real32), | intent(out), | dimension(..) | :: | input |
Weights and biases to initialise |
|
| integer, | intent(in), | optional | :: | fan_in |
Number of input and output parameters |
|
| integer, | intent(in), | optional | :: | fan_out |
Number of input and output parameters |
|
| integer, | intent(in), | optional, | dimension(:) | :: | spacing |
Spacing of the input and output units (not used) |
Initialise the weights and biases using the LeCun uniform distribution
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lecun_uniform_init_type), | intent(inout) | :: | this |
Instance of the Glorot initialiser |
||
| real(kind=real32), | intent(out), | dimension(..) | :: | input |
Weights and biases to initialise |
|
| integer, | intent(in), | optional | :: | fan_in |
Number of input and output units |
|
| integer, | intent(in), | optional | :: | fan_out |
Number of input and output units |
|
| integer, | intent(in), | optional, | dimension(:) | :: | spacing |
Spacing of the input and output units (not used) |