get_num_params_full Function

private pure function get_num_params_full(this) result(num_params)

Get the number of parameters for fully connected layer

This function calculates the number of parameters for a fully connected layer. This procedure is based on code from the neural-fortran library

Type Bound

full_layer_type

Arguments

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

Instance of the fully connected layer

Return Value integer

Number of parameters


Source Code

  pure function get_num_params_full(this) result(num_params)
    !! Get the number of parameters for fully connected layer
    !!
    !! This function calculates the number of parameters for a fully connected
    !! layer.
    !! This procedure is based on code from the neural-fortran library
    implicit none

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

    num_params = ( this%num_inputs + 1 )* this%num_outputs

  end function get_num_params_full