[英]Is it possible to see the output after Conv2D layer in Keras
I am trying to understand each layer of Keras while implementing CNN.我在实施 CNN 时试图了解 Keras 的每一层。
In Conv2D layer i understand that it creates different convolution layer depending on various feature map values.在 Conv2D 层中,我知道它根据不同的特征图值创建不同的卷积层。
Now, My question is that现在,我的问题是
Thanks in advance提前致谢
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.其中 'input' 和 'conv' 表示输入层和卷积层的名称。 And you can get the weights of a certain layer like this:
您可以像这样获得某个层的权重:
conv_weights = model.get_layer('conv').get_weights() # numpy array
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.