get_num_params_gno Function

private pure function get_num_params_gno(this) result(num_params)

Get the number of learnable parameters

Parameters: params(1): packed kernel MLP [Hd + H + FH + F, 1] where F = F_out * F_in Layout: U [Hd] | b_u [H] | V [FH] | b_v [F] params(2): W - linear bypass weights [F_out * F_in, 1] params(3): b - output bias [F_out, 1] (optional)

Type Bound

graph_nop_layer_type

Arguments

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

Layer instance

Return Value integer

Total number of learnable parameters


Source Code

  pure function get_num_params_gno(this) result(num_params)
    !! Get the number of learnable parameters
    !!
    !! Parameters:
    !!   params(1): packed kernel MLP [H*d + H + F*H + F, 1]
    !!              where F = F_out * F_in
    !!              Layout: U [H*d] | b_u [H] | V [F*H] | b_v [F]
    !!   params(2): W   - linear bypass weights  [F_out * F_in, 1]
    !!   params(3): b   - output bias            [F_out, 1]  (optional)
    implicit none

    ! Arguments
    class(graph_nop_layer_type), intent(in) :: this
    !! Layer instance
    integer :: num_params
    !! Total number of learnable parameters

    ! Local variables
    integer :: F_in, F_out, d, H, F
    !! Input/output feature counts, coordinate size, hidden width and flattened kernel width

    F_in  = this%num_vertex_features(0)
    F_out = this%num_vertex_features(1)
    d     = this%coord_dim
    H     = this%kernel_hidden
    F     = F_out * F_in

    num_params = &
         H * d + H + F * H + F + &   ! kernel MLP (U, b_u, V, b_v)
         F_out * F_in                  ! W (linear bypass)
    if(this%use_bias) num_params = num_params + F_out  ! b

  end function get_num_params_gno