Skip to content

Commit d4e55b6

Browse files
committed
Allowing backward 1D from RNN
1 parent c5c45c8 commit d4e55b6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/nf/nf_layer_submodule.f90

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ pure module subroutine backward_1d(self, previous, gradient)
4949
call this_layer % backward(prev_layer % output, gradient)
5050
end select
5151

52+
type is(rnn_layer)
53+
54+
select type(prev_layer => previous % p)
55+
type is(input1d_layer)
56+
call this_layer % backward(prev_layer % output, gradient)
57+
type is(dense_layer)
58+
call this_layer % backward(prev_layer % output, gradient)
59+
type is(flatten_layer)
60+
call this_layer % backward(prev_layer % output, gradient)
61+
type is(rnn_layer)
62+
call this_layer % backward(prev_layer % output, gradient)
63+
end select
64+
5265
end select
5366

5467
end subroutine backward_1d

0 commit comments

Comments
 (0)