get_num_params_conv Module Function

pure module function get_num_params_conv(this) result(num_params)

Get the number of parameters in convolutional layer

Arguments

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

Instance of the layer

Return Value integer

Number of parameters


Source Code

  pure module function get_num_params_conv(this) result(num_params)
    !! Get the number of parameters in convolutional layer
    implicit none

    ! Arguments
    class(conv_layer_type), intent(in) :: this
    !! Instance of the layer
    integer :: num_params
    !! Number of parameters

    ! num_filters x num_channels x kernel_size + num_biases
    ! num_biases = num_filters
    num_params = this%num_filters * this%num_channels * product(this%knl) + &
         this%num_filters

  end function get_num_params_conv