%% Visualize Convolutional Neural Network Features
% Load a pretrained AlexNet network.

net = alexnet;

% Visualize the first 25 features learned by the first convolutional layer ('conv1') using deepDreamImage. Set 'PyramidLevels' to 1 so that the images are not scaled.

layer = 'conv1';
channels = 1:25;

I = deepDreamImage(net,layer,channels, ...
    'PyramidLevels',1, ...
    'Verbose',0);

figure
for i = 1:25
    subplot(5,5,i)
    imshow(I(:,:,:,i))
end

% Copyright 2012 The MathWorks, Inc.