print_to_unit_full Subroutine

private subroutine print_to_unit_full(this, unit)

Uses

    • coreutils

Print fully connected layer to unit

Type Bound

full_layer_type

Arguments

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

Instance of the fully connected layer

integer, intent(in) :: unit

File unit


Source Code

  subroutine print_to_unit_full(this, unit)
    !! Print fully connected layer to unit
    use coreutils, only: to_upper
    implicit none

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


    ! Write initial parameters
    !---------------------------------------------------------------------------
    write(unit,'(3X,"NUM_INPUTS = ",I0)') this%num_inputs
    write(unit,'(3X,"NUM_OUTPUTS = ",I0)') this%num_outputs

    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)
    if(this%use_bias)then
       write(unit,'(5(E16.8E2))') this%params(2)%val(:,1)
    end if
    write(unit,'("END WEIGHTS")')

  end subroutine print_to_unit_full