ones_initialise Subroutine

private pure subroutine ones_initialise(this, input, fan_in, fan_out, spacing)

Initialise the weights and biases using the Ones distribution

Type Bound

ones_init_type

Arguments

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

Instance of the Ones initialiser

real(kind=real32), intent(out), dimension(..) :: input

Weights and biases to initialise

integer, intent(in), optional :: fan_in

Number of input and output parameters

integer, intent(in), optional :: fan_out

Number of input and output parameters

integer, intent(in), optional, dimension(:) :: spacing

Spacing of the input and output units


Source Code

  pure subroutine ones_initialise(this, input, fan_in, fan_out, spacing)
    !! Initialise the weights and biases using the Ones distribution
    implicit none

    ! Arguments
    class(ones_init_type), intent(inout) :: this
    !! Instance of the Ones initialiser
    real(real32), dimension(..), intent(out) :: input
    !! Weights and biases to initialise
    integer, optional, intent(in) :: fan_in, fan_out
    !! Number of input and output parameters
    integer, dimension(:), optional, intent(in) :: spacing
    !! Spacing of the input and output units

    select rank(input)
    rank(0)
       input = 1._real32
    rank(1)
       input = 1._real32
    rank(2)
       input = 1._real32
    rank(3)
       input = 1._real32
    rank(4)
       input = 1._real32
    rank(5)
       input = 1._real32
    rank(6)
       input = 1._real32
    end select

  end subroutine ones_initialise