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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=ik), | intent(in) | :: | dims(:) | |||
| character(len=*), | intent(in), | optional | :: | activation |
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