init_msgpass Module Subroutine

module subroutine init_msgpass(this, input_shape, verbose)

Initialise the layer

Arguments

Type IntentOptional Attributes Name
class(msgpass_layer_type), intent(inout) :: this

Instance of the layer type

integer, intent(in), dimension(:) :: input_shape

Input shape

integer, intent(in), optional :: verbose

Verbosity level


Source Code

  module subroutine init_msgpass(this, input_shape, verbose)
    !! Initialise the layer
    implicit none

    ! Arguments
    class(msgpass_layer_type), intent(inout) :: this
    !! Instance of the layer type
    integer, dimension(:), intent(in) :: input_shape
    !! Input shape
    integer, optional, intent(in) :: verbose
    !! Verbosity level

    ! Local variables
    integer :: t
    !! Time step
    integer :: verbose_ = 0
    !! Verbosity level
    integer :: num_params_message
    !! Number of parameters in the message
    integer :: num_params_readout
    !! Number of parameters in the readout


    !---------------------------------------------------------------------------
    ! Initialise optional arguments
    !---------------------------------------------------------------------------
    if(present(verbose)) verbose_ = verbose


    !---------------------------------------------------------------------------
    ! Initialise number of inputs
    !---------------------------------------------------------------------------
    this%input_shape = [ 1 ] !input_shape
    ! this%output_shape = this%num_outputs
    !if(.not.allocated(this%input_shape)) call this%set_shape(input_shape)
    this%num_params = this%get_num_params()


    !---------------------------------------------------------------------------
    ! Allocate arrays
    !---------------------------------------------------------------------------
    if(allocated(this%output)) deallocate(this%output)

  end subroutine init_msgpass