MATLAB Answers

Convolutional autoencoder layers and training options

66 ビュー (過去 30 日間)
Kenneth Afebu
Kenneth Afebu 2020 年 10 月 16 日
回答済み: Chidvi Modala 2020 年 10 月 27 日
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.

回答 (1 件)

Chidvi Modala
Chidvi Modala 2020 年 10 月 27 日
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])
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!

Community Treasure Hunt

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

Start Hunting!

Translated by