get_num_params_neural_operator Function

private pure function get_num_params_neural_operator(this) result(num_params)

Get the number of parameters for the neural operator layer

Parameters consist of: - W matrix : num_outputs * num_inputs - W_k vector : num_outputs (integral kernel coupling) - b vector : num_outputs (if use_bias)

Type Bound

neural_operator_layer_type

Arguments

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

Instance of the neural operator layer

Return Value integer

Number of parameters


Source Code

  pure function get_num_params_neural_operator(this) result(num_params)
    !! Get the number of parameters for the neural operator layer
    !!
    !! Parameters consist of:
    !!   - W matrix : num_outputs * num_inputs
    !!   - W_k vector : num_outputs (integral kernel coupling)
    !!   - b vector : num_outputs (if use_bias)
    implicit none

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

    ! W: n_out * n_in, W_k: n_out, b: n_out (if use_bias)
    num_params = this%num_outputs * this%num_inputs + this%num_outputs
    if(this%use_bias) num_params = num_params + this%num_outputs

  end function get_num_params_neural_operator