Visualizing the output of intermediate layers of cnn in pytorch
I'm trying to visualize the output of the intermediate layers of the VGG19 network, from the torchvision module, specifically the layer, conv4_2. 
I've extracted the output in a tensor of shape [1, 512, 50, 50]. 
But how do I visualize an image with 512 channels?

Feature visualization is a very complex subject.
If you want to have a visual idea what each filter (of the 512) of the trained net is responding to, you can use methods like these: propagating gradients from conv4_2's output to the input image, and change the image to maximize the feature response. You will have to work your way through regularization etc. to get smooth visually pleasing results.

Alternatively, you can see the specific responses of each filter (out of the 512) to each location (overlapping receptive fields). In that case you have 512 different 50-by-50 intensity images, each showing the response map of each neuron to the input image.
