lr_decay_inv Function

private pure function lr_decay_inv(this, learning_rate, iteration) result(output)

Get the learning rate for the inverse decay type

Type Bound

inv_lr_decay_type

Arguments

Type IntentOptional Attributes Name
class(inv_lr_decay_type), intent(in) :: this

Instance of the inverse learning rate decay type

real(kind=real32), intent(in) :: learning_rate

Initial learning rate

integer, intent(in) :: iteration

Iteration number

Return Value real(kind=real32)

Learning rate


Source Code

  pure function lr_decay_inv(this, learning_rate, iteration) result(output)
    !! Get the learning rate for the inverse decay type
    implicit none

    ! Arguments
    class(inv_lr_decay_type), intent(in) :: this
    !! Instance of the inverse 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 * &
         (1._real32 + this%decay_rate * iteration) ** (- this%decay_power)

  end function lr_decay_inv