Skip to content

Commit 3d10570

Browse files
committed
Apply loss function if RNN is the output layer
1 parent c3f93cf commit 3d10570

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/nf/nf_network_submodule.f90

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,11 @@ pure module subroutine backward(self, output)
317317
self % layers(n - 1), &
318318
quadratic_derivative(output, this_layer % output) &
319319
)
320+
type is(rnn_layer)
321+
call self % layers(n) % backward( &
322+
self % layers(n - 1), &
323+
quadratic_derivative(output, this_layer % output) &
324+
)
320325
end select
321326
else
322327
! Hidden layer; take the gradient from the next layer

0 commit comments

Comments
 (0)