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

2 ビュー (過去 30 日間)
Pablo Dias
Pablo Dias 2017 年 11 月 22 日
回答済み: DS 2018 年 4 月 6 日
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 Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by