- Run the flatten_conv_layer function with the preceding input parameter:
flatten_lay <- flatten_conv_layer(layer_conv2)
- Extract the flattened layer:
layer_flat <- flatten_lay$layer_flat
- Extract the number of (input) features generated for each image:
num_features <- flatten_lay$num_features