Skip to content

Commit 0350c7d

Browse files
committed
Connect the backward pass; expand tests
1 parent ea0012a commit 0350c7d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/nf/nf_layer_submodule.f90

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ pure module subroutine backward_1d(self, previous, gradient)
3939
call this_layer % backward(prev_layer % output, gradient)
4040
end select
4141

42+
type is(dropout_layer)
43+
44+
! Upstream layers permitted: input1d, dense, dropout, flatten
45+
select type(prev_layer => previous % p)
46+
type is(input1d_layer)
47+
call this_layer % backward(prev_layer % output, gradient)
48+
type is(dense_layer)
49+
call this_layer % backward(prev_layer % output, gradient)
50+
type is(flatten_layer)
51+
call this_layer % backward(prev_layer % output, gradient)
52+
end select
53+
4254
type is(flatten_layer)
4355

4456
! Upstream layers permitted: input2d, input3d, conv2d, maxpool2d

0 commit comments

Comments
 (0)