Visualizing the FC layers

Hello,

I have trained a network. I want to visualize the output of each layers when I forward pass an image. I can see how i can visualize the intermediate layers as they are already in (heightwidthchannels). When it comes to the fully connected they are (samples * 1d vector). How will i reconstruct this back to (samples * height * width) format so that I can visualize what features it has learnt.

Thanks in advance for the help

check the deepdream by google which basically generate image that specifically activates certain neuron

  1. https://www.mathworks.com/help/nnet/examples/visualize-features-of-a-convolutional-neural-network.html (matlab)
  2. https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/deepdream/deepdream.ipynb (tensorflow)

I couldn’t find the PyTorch version.

There are several third party implementations. You could have a look at this to begin with.