How can I create a stack of autoencoders and a softmaxLayer from a Vector of autoencoders?

1 次查看(过去 30 天)
I am trying to create an stack of autoencoders, from the code below:
stackedNet = stack(vector_autoencoders(:),softnet);
but I'm getting the following message: "Expected one output from a curly brace or dot indexing expression, but there were 2 results."
There are 2 autoencoders in my vector with proper dimensions. If I use the following code it works:
stackedNet = stack(vector_autoencoders(1),vector_autoencoders(2),softnet);
What am I doing wrong? Is there any other way to use stack, without enumerating every autoencoder?

回答(1 个)

DS
DS 2018-4-6
Hi Pablo,
if vector_autoencoders is a cell array you can add your AE in a for loop by:
vector_autoencoders{end+1} = trainAutoencoder(...)
Afterwards, you can stack them as follows:
stackedNet = stack(vector_autoencoders{:,:},softnet);

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by