www.gusucode.com > nnet 案例源码 matlab代码程序 > nnet/VisualizeLearnedFeaturesExample.m

    %% Visualize Learned Features
% Load the training data.
X = digitTrainCellArrayData;
%%
% The training data is a 1-by-5003 cell array, where each cell contains a
% 28-by-28 matrix representing a synthetic image of a handwritten digit.
%%
% Train an autoencoder with a hidden layer of 25 neurons.
hiddenSize = 25;
autoenc = trainAutoencoder(X,hiddenSize, ...
  'L2WeightRegularization',0.004, ...
  'SparsityRegularization',4, ...
  'SparsityProportion',0.2);
%%
% Visualize the learned features.
plotWeights(autoenc);