Get the learning rate for the step decay type
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(step_lr_decay_type), | intent(in) | :: | this |
Instance of the step learning rate decay type |
||
| real(kind=real32), | intent(in) | :: | learning_rate |
Initial learning rate |
||
| integer, | intent(in) | :: | iteration |
Iteration number |
Learning rate
pure function lr_decay_step(this, learning_rate, iteration) result(output) !! Get the learning rate for the step decay type implicit none ! Arguments class(step_lr_decay_type), intent(in) :: this !! Instance of the step learning rate decay type real(real32), intent(in) :: learning_rate !! Initial learning rate integer, intent(in) :: iteration !! Iteration number real(real32) :: output !! Learning rate output = learning_rate * this%decay_rate ** (iteration / this%decay_steps) end function lr_decay_step