get_num_params_recurrent Function

private pure function get_num_params_recurrent(this) result(num_params)

Type Bound

recurrent_layer_type

Arguments

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

Return Value integer


Source Code

  pure function get_num_params_recurrent(this) result(num_params)
    implicit none
    class(recurrent_layer_type), intent(in) :: this
    integer :: num_params

    num_params = &
         this%hidden_size * this%input_size + &  ! W_ih
         this%hidden_size * this%hidden_size     ! W_hh
    if(this%use_bias)then
       num_params = num_params + 2 * this%hidden_size    ! b_h + b_o
    end if

  end function get_num_params_recurrent