How to create your own Autoencoder?

10 views (last 30 days)
Lovro Sindicic
Lovro Sindicic on 24 Jul 2022
Answered: Udit06 on 22 Nov 2024 at 9:18
I am trying to make an autoencoder that would work on the ORL dataset. I have the images ready in vectors(1024 * 400) and I was thinking of making an autoencoder with a linear (fully connected) layer.
Of course, with the help of the Internet and a little searching, you can come across the trainAutoencoder function.
network = trainAutoencoder(fea, 512)
But in this function I can't make an autoencoder with multiple layers?? By googling, I found stack autoencoder, which solves that problem. But I ask here a few questions about how to change the activation function (for example ReLu), and not the sigmoid that comes automatically.
autoenc1 = [featureInputLayer(32*32)
fullyConnectedLayer(16*16,"Name","fc_1")
reluLayer("Name","relu_1")
fullyConnectedLayer(8*8,"Name","fc_2")
fullyConnectedLayer(16*16,"Name","fc_3")
reluLayer("Name","relu_2")
fullyConnectedLayer(32*32,"Name","fc_4")
classificationLayer("Name","classoutput")]
Also, the question is whether it is possible to write an autoencoder in this way? I know the classification output doesn't make sense with an unsupervised network, but MatLab was forcing me to set something up. Is it possible to make an autoencoder using Deep Network Designer?

Answers (1)

Udit06
Udit06 on 22 Nov 2024 at 9:18
Hi Lovro,
You can refer to the following MATLAB answer which explains how to create an autoencoder in MATLAB using Deep Network Designer:

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!