Module containing regularisation methods
This module contains regularisation methods to prevent overfitting in neural networks
Regularise the parameters
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(base_regulariser_type), | intent(in) | :: | this |
Regulariser object |
||
| real(kind=real32), | intent(in), | dimension(:) | :: | params |
Parameters to regularise |
|
| real(kind=real32), | intent(inout), | dimension(:) | :: | gradient |
Gradient of the parameters |
|
| real(kind=real32), | intent(in) | :: | learning_rate |
Learning rate |
Abstract type for regularisation
| procedure(regularise), public, deferred, pass(this) :: regularise | Regularisation method |
Type for L1 regularisation
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real32), | public | :: | l1 | = | 0.01_real32 |
| procedure, public, pass(this) :: regularise => regularise_l1 | Regularisation method |
Type for L1 and L2 regularisation
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real32), | public | :: | l1 | = | 0.01_real32 |
L1 regularisation parameter |
|
| real(kind=real32), | public | :: | l2 | = | 0.01_real32 |
L2 regularisation parameter |
| procedure, public, pass(this) :: regularise => regularise_l1l2 | Regularisation method |
Type for L2 regularisation
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | decoupled | = | .true. |
Use decoupled weight decay regularisation |
|
| real(kind=real32), | public | :: | l2 | = | 0.01_real32 |
Regularisation parameter |
|
| real(kind=real32), | public | :: | l2_decoupled | = | 0.01_real32 |
Decoupled weight decay regularisation parameter |
| procedure, public, pass(this) :: regularise => regularise_l2 | Regularisation method |
Regularise the parameters using L1 regularisation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(l1_regulariser_type), | intent(in) | :: | this |
Instance of the L1 regulariser |
||
| real(kind=real32), | intent(in), | dimension(:) | :: | params |
Parameters to regularise |
|
| real(kind=real32), | intent(inout), | dimension(:) | :: | gradient |
Gradient of the parameters |
|
| real(kind=real32), | intent(in) | :: | learning_rate |
Learning rate |
Regularise the parameters using L1 and L2 regularisation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(l1l2_regulariser_type), | intent(in) | :: | this |
Instance of the L1 and L2 regulariser |
||
| real(kind=real32), | intent(in), | dimension(:) | :: | params |
Parameters to regularise |
|
| real(kind=real32), | intent(inout), | dimension(:) | :: | gradient |
Gradient of the parameters |
|
| real(kind=real32), | intent(in) | :: | learning_rate |
Learning rate |
Regularise the parameters using L2 regularisation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(l2_regulariser_type), | intent(in) | :: | this |
Instance of the L2 regulariser |
||
| real(kind=real32), | intent(in), | dimension(:) | :: | params |
Parameters to regularise |
|
| real(kind=real32), | intent(inout), | dimension(:) | :: | gradient |
Gradient of the parameters |
|
| real(kind=real32), | intent(in) | :: | learning_rate |
Learning rate |