Convolutional autoencoder layers and training options

32 views (last 30 days)
Hi all;
Please can anyone help me with a typical convolutional autoencoder code including its "layers array" and "training options" execuitable on MATLAB while also pointing out the encoding and decoding parts of the layers.
I have been trying to do so but I have not been able as I am new to it.
Thanks in advance.

Answers (1)

Chidvi Modala
Chidvi Modala on 27 Oct 2020
Hi Kenneth,
You can make use of Autoencoder object containing an autoencoder network, which consists of an encoder and a decoder.
  • To create an Autoencoder, you may use trainAutoEncoder(X), which returns an autoencoder trained using the training data X.
  • To specify the parameters that trainAutoEncoder uses for training the autoencoder, you may use TrainingParameters property.
  • For encoding, you may use encode(autoenc,Xnew) which returns the encoded data for the input data Xnew, using the autoencoder, autoenc.
  • For decoding, you may use decode(autoenc,Z) which returns the decoded data using the autoencoder, autoenc.
You can define custom architecture of autoencoder using deep learning layers. You can refer to this documentation for the list of deep learning layers supported in MATLAB. For example, a convolutional layer can be created as
layer = convolution2dLayer(11,96,'Stride',4)
% Includes a convolutional layer in a layers array
layers = [
imageInputLayer([28 28 1])
convolution2dLayer(5,20)
reluLayer
maxPooling2dLayer(2,'Stride',2)
fullyConnectedLayer(10)
softmaxLayer
classificationLayer];
You can use 2D / 3D conv layer/ any other layer as per your architecture. After defining the network, you can train the model. You can refer to this documentation .
Hope it helps!
  1 Comment
Artem Lensky
Artem Lensky on 30 May 2021
You are referring to the toolbox that implements shallow networks, and it does not provide CNN layers. Can someone among the experienced staff please address this question?

Sign in to comment.

Categories

Find more on Image Data Workflows in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!