Trained autoencoder, returned as an object of the Autoencoder class.
Xnew — Input data matrix | cell array of image data | array of single image data
Input data, specified as a matrix of samples, a cell array of
image data, or an array of single image data.
If the autoencoder autoenc was trained
on a matrix, where each column represents a single sample, then Xnew must
be a matrix, where each column represents a single sample.
If the autoencoder autoenc was trained
on a cell array of images, then Xnew must either
be a cell array of image data or an array of single image data.
The training data contains measurements on four attributes of iris flowers: Sepal length, sepal width, petal length, petal width.
Train an autoencoder on the training data using the positive saturating linear transfer function in the encoder and linear transfer function in the decoder.
Reconstruct the measurements using the trained network, autoenc.
xReconstructed = predict(autoenc,X);
Plot the predicted measurement values along with the actual values in the training dataset.
for i = 1:4
h(i) = subplot(1,4,i);
plot(X(i,:),'r.');
hold on
plot(xReconstructed(i,:),'go');
hold off;
end
title(h(1),{'Sepal';'Length'});
title(h(2),{'Sepal';'Width'});
title(h(3),{'Petal';'Length'});
title(h(4),{'Petal';'Width'});
The red dots represent the training data and the green circles represent the reconstructed data.
Reconstruct Handwritten Digit Images Using Sparse Autoencoder
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.