@@ -79,7 +79,8 @@ module function network_from_keras(filename) result(res)
79
79
layers(n) = conv2d( &
80
80
keras_layers(n) % filters, &
81
81
! FIXME add support for non-square kernel
82
- keras_layers(n) % kernel_size(1 ) &
82
+ keras_layers(n) % kernel_size(1 ), &
83
+ keras_layers(n) % activation &
83
84
)
84
85
85
86
case (' Dense' )
@@ -162,7 +163,7 @@ module function network_from_keras(filename) result(res)
162
163
163
164
type is (maxpool2d_layer)
164
165
! Nothing to do
165
- continue
166
+ continue
166
167
167
168
class default
168
169
error stop ' Internal error in network_from_keras(); ' &
@@ -258,6 +259,8 @@ module function output_1d(self, input) result(res)
258
259
res = output_layer % output
259
260
type is (flatten_layer)
260
261
res = output_layer % output
262
+ class default
263
+ error stop ' network % output not implemented for this output layer'
261
264
end select
262
265
263
266
end function output_1d
@@ -274,10 +277,15 @@ module function output_3d(self, input) result(res)
274
277
call self % forward(input)
275
278
276
279
select type (output_layer = > self % layers(num_layers) % p)
280
+ type is (conv2d_layer)
281
+ ! FIXME flatten the result for now; find a better solution
282
+ res = pack (output_layer % output, .true. )
277
283
type is (dense_layer)
278
284
res = output_layer % output
279
285
type is (flatten_layer)
280
286
res = output_layer % output
287
+ class default
288
+ error stop ' network % output not implemented for this output layer'
281
289
end select
282
290
283
291
end function output_3d
0 commit comments