Apply gradients to parameters to minimise loss using base optimiser
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(base_optimiser_type), | intent(inout) | :: | this |
Instance of the base optimiser |
||
| real(kind=real32), | intent(inout), | dimension(:) | :: | param |
Parameters |
|
| real(kind=real32), | intent(inout), | dimension(:) | :: | gradient |
Gradients |
pure subroutine minimise_base(this, param, gradient) !! Apply gradients to parameters to minimise loss using base optimiser implicit none ! Arguments class(base_optimiser_type), intent(inout) :: this !! Instance of the base optimiser real(real32), dimension(:), intent(inout) :: param !! Parameters real(real32), dimension(:), intent(inout) :: gradient !! Gradients ! Local variables real(real32) :: learning_rate !! Learning rate ! Decay learning rate and update iteration learning_rate = this%lr_decay%get_lr(this%learning_rate, this%iter) ! Update parameters param = param - learning_rate * gradient end subroutine minimise_base