Module containing implementation of the SELU activation function
This module implements Scaled Exponential Linear Unit (SELU), which has self-normalizing properties for deep networks.
Mathematical operation:
where and preserve mean=0, variance=1
Derivative:
Properties: Self-normalizing, enables very deep networks Requires: Lecun Normal initialisation, alpha dropout Reference: Klambauer et al. (2017), NeurIPS
Initialise a SELU activation function
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in), | optional | :: | scale |
Optional scale factor for activation output |
|
| real(kind=real32), | intent(in), | optional | :: | alpha |
Optional alpha parameter (default: 1.67326) |
|
| real(kind=real32), | intent(in), | optional | :: | lambda |
Optional lambda parameter (default: 1.0507) |
|
| type(onnx_attribute_type), | intent(in), | optional | :: | attributes(:) |
Optional ONNX attributes |
SELU activation type
Type for SELU activation function with overloaded procedures
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real32), | public | :: | alpha | = | 1.6732632423543772848170429916717_real32 |
Alpha parameter for SELU |
|
| logical, | public | :: | apply_scaling | = | .false. |
Boolean to apply scaling or not |
|
| real(kind=real32), | public | :: | lambda | = | 1.0507009873554804934193349852946_real32 |
Lambda parameter for SELU |
|
| character(len=10), | public | :: | name |
Name of the activation function |
|||
| real(kind=real32), | public | :: | scale | = | 1._real32 |
Scale of the activation function |
|
| real(kind=real32), | public | :: | threshold |
Threshold of the activation function |
| private function initialise (scale, alpha, lambda, attributes) | Initialise a SELU activation function |
| procedure, public, pass(this) :: apply => apply_selu | |
| procedure, public, pass(this) :: apply_attributes => apply_attributes_selu | |
| procedure, public, pass(this) :: export_attributes => export_attributes_selu | |
| procedure, public, pass(this) :: print_to_unit => print_to_unit_actv | |
| procedure, public, pass(this) :: reset => reset_selu |
Create SELU activation function from ONNX attributes
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(onnx_attribute_type), | intent(in), | dimension(:) | :: | attributes |
Array of ONNX attributes |
Instance of activation type
Apply SELU activation to array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(selu_actv_type), | intent(in) | :: | this |
SELU activation type |
||
| type(array_type), | intent(in) | :: | val |
Input values |
Activated output values
Export SELU activation function attributes as ONNX attributes
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(selu_actv_type), | intent(in) | :: | this |
SELU activation type |
Array of ONNX attributes
Initialise a SELU activation function
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in), | optional | :: | scale |
Optional scale factor for activation output |
|
| real(kind=real32), | intent(in), | optional | :: | alpha |
Optional alpha parameter (default: 1.67326) |
|
| real(kind=real32), | intent(in), | optional | :: | lambda |
Optional lambda parameter (default: 1.0507) |
|
| type(onnx_attribute_type), | intent(in), | optional | :: | attributes(:) |
Optional ONNX attributes |
SELU activation type
Load ONNX attributes into SELU activation function
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(selu_actv_type), | intent(inout) | :: | this |
SELU activation type |
||
| type(onnx_attribute_type), | intent(in), | dimension(:) | :: | attributes |
Array of ONNX attributes |
Reset SELU activation function attributes and variables
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(selu_actv_type), | intent(inout) | :: | this |
SELU activation type |