问题
I am trying to understand each layer of Keras while implementing CNN.
In Conv2D layer i understand that it creates different convolution layer depending on various feature map values.
Now, My question is that
- Can i see different feature map matrix that are applied on input image to get the convolution layer
- Can i see the value of matrix that is generated after completion of Conv2D step.
Thanks in advance
回答1:
You can get the output of a certain convolutional layer in this way:
import keras.backend as K
func = K.function([model.get_layer('input').input], model.get_layer('conv').output)
conv_output = func([numpy_input]) # numpy array
where 'input' and 'conv' denote the names of your input layer and convolutional layer. And you can get the weights of a certain layer like this:
conv_weights = model.get_layer('conv').get_weights() # numpy array
来源:https://stackoverflow.com/questions/59555321/is-it-possible-to-see-the-output-after-conv2d-layer-in-keras