Reset gradients
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of network |
module subroutine reset_gradients(this) !! Reset gradients implicit none ! Arguments class(network_type), intent(inout) :: this !! Instance of network ! Local variables integer :: l, i !! Loop index do l = 1, this%num_layers select type(current => this%model(l)%layer) class is(learnable_layer_type) do i = 1, size(current%params) call current%params(i)%zero_grad() end do end select end do end subroutine reset_gradients