print_to_unit_recurrent Subroutine

private subroutine print_to_unit_recurrent(this, unit)

Uses

    • coreutils

Print recurrent layer to unit

Type Bound

recurrent_layer_type

Arguments

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

Instance of the fully connected layer

integer, intent(in) :: unit

File unit


Source Code

  subroutine print_to_unit_recurrent(this, unit)
    !! Print recurrent layer to unit
    use coreutils, only: to_upper
    implicit none

    ! Arguments
    class(recurrent_layer_type), intent(in) :: this
    !! Instance of the fully connected layer
    integer, intent(in) :: unit
    !! File unit


    ! Write initial parameters
    !---------------------------------------------------------------------------
    write(unit,'(3X,"INPUT_SIZE = ",I0)') this%input_size
    write(unit,'(3X,"HIDDEN_SIZE = ",I0)') this%hidden_size

    write(unit,'(3X,"USE_BIAS = ",L1)') this%use_bias
    if(this%activation%name .ne. 'none')then
       call this%activation%print_to_unit(unit)
    end if


    ! Write fully connected weights and biases
    !---------------------------------------------------------------------------
    write(unit,'("WEIGHTS")')
    write(unit,'(5(E16.8E2))') this%params(1)%val(:,1)
    write(unit,'(5(E16.8E2))') this%params(2)%val(:,1)
    if(this%use_bias)then
       write(unit,'(5(E16.8E2))') this%params(3)%val(:,1)
       write(unit,'(5(E16.8E2))') this%params(4)%val(:,1)
    end if
    write(unit,'("END WEIGHTS")')

  end subroutine print_to_unit_recurrent