reduce_conv3d Subroutine

private subroutine reduce_conv3d(this, input)

Merge two 3D convolutional layers via parameter summation

Type Bound

conv3d_layer_type

Arguments

Type IntentOptional Attributes Name
class(conv3d_layer_type), intent(inout) :: this
class(learnable_layer_type), intent(in) :: input

Source Code

  subroutine reduce_conv3d(this, input)
    !! Merge two 3D convolutional layers via parameter summation
    implicit none

    class(conv3d_layer_type), intent(inout) :: this
    class(learnable_layer_type), intent(in) :: input

    real(real32), allocatable :: params(:), gradients(:)

    select type(input)
    type is (conv3d_layer_type)
       params = this%get_params() + input%get_params()
       call this%set_params(params)

       gradients = this%get_gradients() + input%get_gradients()
       call this%set_gradients(gradients)
    class default
       call stop_program("reduce_conv3d: incompatible layer type")
    end select

  end subroutine reduce_conv3d