reset_state Module Subroutine

module subroutine reset_state(this)

Reset the hidden state of all layers in the network

Arguments

Type IntentOptional Attributes Name
class(network_type), intent(inout) :: this

Instance of network


Source Code

  module subroutine reset_state(this)
    !! Reset the hidden state of all layers in the network
    implicit none

    ! Arguments
    class(network_type), intent(inout) :: this
    !! Instance of network

    ! Local variables
    integer :: l
    !! Loop index

    do l = 1, size(this%model, dim = 1)
       select type( layer => this%model(l)%layer )
       class is(recurrent_layer_type)
          call layer%reset_state()
       end select
    end do

  end subroutine reset_state