Initialise the weights and biases using the data distribution
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(data_init_type), | intent(inout) | :: | this |
Instance of the data 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 |
pure subroutine data_initialise(this, input, fan_in, fan_out, spacing) !! Initialise the weights and biases using the data distribution implicit none ! Arguments class(data_init_type), intent(inout) :: this !! Instance of the data 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 = this%data(1) rank(1) input(:) = this%data(:) rank(2) input(:,:) = reshape(this%data, shape(input)) rank(3) input(:,:,:) = reshape(this%data, shape(input)) rank(4) input(:,:,:,:) = reshape(this%data, shape(input)) rank(5) input(:,:,:,:,:) = reshape(this%data, shape(input)) rank(6) input(:,:,:,:,:,:) = reshape(this%data, shape(input)) end select end subroutine data_initialise