net_constructor Function

private function net_constructor(dims, activation) result(net)

Network class constructor. Size of input array dims indicates the total number of layers (input + hidden + output), and the value of its elements corresponds the size of each layer.

Arguments

Type IntentOptional AttributesName
integer(kind=ik), intent(in) :: dims(:)
character(len=*), intent(in), optional :: activation

Return Value type(network_type)


Called by

proc~~net_constructor~~CalledByGraph proc~net_constructor net_constructor interface~network_type network_type interface~network_type->proc~net_constructor

Contents

Source Code


Source Code

  type(network_type) function net_constructor(dims, activation) result(net)
    !! Network class constructor. Size of input array dims indicates the total
    !! number of layers (input + hidden + output), and the value of its elements
    !! corresponds the size of each layer.
    integer(ik), intent(in) :: dims(:)
    character(len=*), intent(in), optional :: activation
    call net % init(dims)
    if (present(activation)) then
      call net % set_activation(activation)
    else
      call net % set_activation('sigmoid')
    end if
    call net % sync(1)
  end function net_constructor