To show the feature maps of every layer in your convolutional neural network (CNN) using MATLAB, you can follow these steps:
analyzeNetwork
function.activations
function.montage
or imshow
functions.Here's some example code:
main.m909 chars33 lines
In this example, we are using the alexnet
pre-trained CNN model that comes with MATLAB. We loop through each layer of the network and only display the feature maps of the convolutional layers. We use a random input image to compute the activations of a layer and then visualize the feature maps using the montage
function. Alternatively, you could use the imshow
function to view the feature maps individually.
gistlibby LogSnag