|
4 | 4 | use nf_conv2d_layer, only: conv2d_layer |
5 | 5 | use nf_dense_layer, only: dense_layer |
6 | 6 | use nf_flatten_layer, only: flatten_layer |
7 | | - use nf_flatten2d_layer, only: flatten2d_layer |
8 | 7 | use nf_input1d_layer, only: input1d_layer |
9 | 8 | use nf_input2d_layer, only: input2d_layer |
10 | 9 | use nf_input3d_layer, only: input3d_layer |
@@ -49,16 +48,8 @@ pure module subroutine backward_1d(self, previous, gradient) |
49 | 48 | call this_layer % backward(prev_layer % output, gradient) |
50 | 49 | type is(maxpool2d_layer) |
51 | 50 | call this_layer % backward(prev_layer % output, gradient) |
52 | | - end select |
53 | | - |
54 | | - type is(flatten2d_layer) |
55 | | - |
56 | | - ! Upstream layers permitted: linear2d_layer |
57 | | - select type(prev_layer => previous % p) |
58 | 51 | type is(linear2d_layer) |
59 | 52 | call this_layer % backward(prev_layer % output, gradient) |
60 | | - type is(input2d_layer) |
61 | | - call this_layer % backward(prev_layer % output, gradient) |
62 | 53 | end select |
63 | 54 |
|
64 | 55 | end select |
@@ -204,14 +195,8 @@ pure module subroutine forward(self, input) |
204 | 195 | call this_layer % forward(prev_layer % output) |
205 | 196 | type is(reshape3d_layer) |
206 | 197 | call this_layer % forward(prev_layer % output) |
207 | | - end select |
208 | | - |
209 | | - type is(flatten2d_layer) |
210 | | - select type(prev_layer => input % p) |
211 | 198 | type is(linear2d_layer) |
212 | 199 | call this_layer % forward(prev_layer % output) |
213 | | - type is(input2d_layer) |
214 | | - call this_layer % forward(prev_layer % output) |
215 | 200 | end select |
216 | 201 |
|
217 | 202 | type is(reshape3d_layer) |
@@ -254,8 +239,6 @@ pure module subroutine get_output_1d(self, output) |
254 | 239 | allocate(output, source=this_layer % output) |
255 | 240 | type is(flatten_layer) |
256 | 241 | allocate(output, source=this_layer % output) |
257 | | - type is(flatten2d_layer) |
258 | | - allocate(output, source=this_layer % output) |
259 | 242 | class default |
260 | 243 | error stop '1-d output can only be read from an input1d, dense, or flatten layer.' |
261 | 244 |
|
@@ -327,8 +310,6 @@ impure elemental module subroutine init(self, input) |
327 | 310 | self % layer_shape = shape(this_layer % output) |
328 | 311 | type is(flatten_layer) |
329 | 312 | self % layer_shape = shape(this_layer % output) |
330 | | - type is(flatten2d_layer) |
331 | | - self % layer_shape = shape(this_layer % output) |
332 | 313 | end select |
333 | 314 |
|
334 | 315 | self % input_layer_shape = input % layer_shape |
@@ -372,8 +353,6 @@ elemental module function get_num_params(self) result(num_params) |
372 | 353 | num_params = 0 |
373 | 354 | type is (flatten_layer) |
374 | 355 | num_params = 0 |
375 | | - type is (flatten2d_layer) |
376 | | - num_params = 0 |
377 | 356 | type is (reshape3d_layer) |
378 | 357 | num_params = 0 |
379 | 358 | type is (linear2d_layer) |
@@ -403,8 +382,6 @@ module function get_params(self) result(params) |
403 | 382 | ! No parameters to get. |
404 | 383 | type is (flatten_layer) |
405 | 384 | ! No parameters to get. |
406 | | - type is (flatten2d_layer) |
407 | | - ! No parameters to get. |
408 | 385 | type is (reshape3d_layer) |
409 | 386 | ! No parameters to get. |
410 | 387 | type is (linear2d_layer) |
@@ -434,8 +411,6 @@ module function get_gradients(self) result(gradients) |
434 | 411 | ! No gradients to get. |
435 | 412 | type is (flatten_layer) |
436 | 413 | ! No parameters to get. |
437 | | - type is (flatten2d_layer) |
438 | | - ! No gradients to get. |
439 | 414 | type is (reshape3d_layer) |
440 | 415 | ! No gradients to get. |
441 | 416 | type is (linear2d_layer) |
@@ -500,11 +475,6 @@ module subroutine set_params(self, params) |
500 | 475 | write(stderr, '(a)') 'Warning: calling set_params() ' & |
501 | 476 | // 'on a zero-parameter layer; nothing to do.' |
502 | 477 |
|
503 | | - type is (flatten2d_layer) |
504 | | - ! No parameters to set. |
505 | | - write(stderr, '(a)') 'Warning: calling set_params() ' & |
506 | | - // 'on a zero-parameter layer; nothing to do.' |
507 | | - |
508 | 478 | type is (reshape3d_layer) |
509 | 479 | ! No parameters to set. |
510 | 480 | write(stderr, '(a)') 'Warning: calling set_params() ' & |
|
0 commit comments