@@ -40,13 +40,14 @@ module mod_network
4040
4141 interface network_type
4242
43- type (network_type) module function net_constructor(dims, activation) result(net)
43+ module function net_constructor (dims , activation ) result(net)
4444 ! ! Network class constructor. Size of input array dims indicates the total
4545 ! ! number of layers (input + hidden + output), and the value of its elements
4646 ! ! corresponds the size of each layer.
4747 implicit none
4848 integer (ik), intent (in ) :: dims(:)
4949 character (len=* ), intent (in ), optional :: activation
50+ type (network_type) :: net
5051 end function net_constructor
5152
5253 end interface network_type
@@ -62,7 +63,6 @@ pure real(rk) module function accuracy(self, x, y)
6263 real (rk), intent (in ) :: x(:,:), y(:,:)
6364 end function accuracy
6465
65-
6666 pure module subroutine backprop(self, y, dw, db)
6767 ! ! Applies a backward propagation through the network
6868 ! ! and returns the weight and bias gradients.
@@ -82,7 +82,6 @@ pure module subroutine fwdprop(self, x)
8282 real (rk), intent (in ) :: x(:)
8383 end subroutine fwdprop
8484
85-
8685 module subroutine init (self , dims )
8786 ! ! Allocates and initializes the layers with given dimensions dims.
8887 implicit none
0 commit comments