简体   繁体   中英

Is it possible to see the output after Conv2D layer in Keras

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

  1. Can i see different feature map matrix that are applied on input image to get the convolution layer
  2. Can i see the value of matrix that is generated after completion of Conv2D step.

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. And you can get the weights of a certain layer like this:

conv_weights = model.get_layer('conv').get_weights()  # numpy array

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM