Trains a network using a single set of input data x and output data y, and learning rate eta.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | self | |||
| real(kind=rk), | intent(in) | :: | x(:) | |||
| real(kind=rk), | intent(in) | :: | y(:) | |||
| real(kind=rk), | intent(in) | :: | eta |
pure subroutine train_single(self, x, y, eta)
!! Trains a network using a single set of input data x and output data y,
!! and learning rate eta.
class(network_type), intent(in out) :: self
real(rk), intent(in) :: x(:), y(:), eta
type(array2d), allocatable :: dw(:)
type(array1d), allocatable :: db(:)
call self % fwdprop(x)
call self % backprop(y, dw, db)
call self % update(dw, db, eta)
end subroutine train_single