0
votes

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

1
Yes, those values can be visualizedDr. Snoopy

1 Answers

2
votes

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