Experiment Manager Setup for LSTM

8 ビュー (過去 30 日間)
Marco Lutz
Marco Lutz 2021 年 9 月 9 日
回答済み: Jorge Calvo 2021 年 9 月 10 日
I want to optimize a LSTM network using the Experiment Manager.
The training data XTrain consists of a cell array. Each cell contains a matrix of type double. The classification is stored in YTrain as a categorical array.
I tried to store the TrainingData in an cell array containg XTrain and YTrain.
function [TrainingData, layers, options] = Experiment1_setup3(params)
load('LSTM_dataset.mat', 'XTrain', 'YTrain', 'XTest', 'YTest')
TrainingData = cell(length(YTrain),1);
for i = length(YTrain)
TrainingData{i} = {XTrain{i} YTrain(i)};
end
inputSize = length(Xtrain{1}(:,1));
numHiddenUnits = 100;
numClasses = length(categories(YTrain));
options = trainingOptions('adam', ...
'ExecutionEnvironment',"auto", ...
'GradientThreshold',1, ...
'MaxEpochs', params.maxEpochs, ...
'MiniBatchSize', params.miniBatchSize, ...
'InitialLearnRate', 0.001, ...
'SequenceLength','longest', ...
'Shuffle','never', ...
'Verbose',0);
I got the following error message:
Error(s) occurred while validating the setup function:
Caused by:
Unable to determine if experiment is for classification or regression because setup function returned invalid outputs.
Not enough input arguments.
I want to ask how to prepare the data for the Experiment Manager since all examples I found use images.
Thank you
  1 件のコメント
Marco Lutz
Marco Lutz 2021 年 9 月 9 日
I found the error. I simply have the change the first line to:
function [XTrain, YTrain, layers, options] = Experiment1_setup3(params)
For optimization of the XTest prediction i had to create a new function following this example https://de.mathworks.com/help/deeplearning/ug/experiment-using-bayesian-optimization.html
I found it untypically difficult for Matlab to find the correct information on this matter.

サインインしてコメントする。

採用された回答

Jorge Calvo
Jorge Calvo 2021 年 9 月 10 日
Hi Marco,
This example documents the various syntaxes you can use for the experiment setup function: https://www.mathworks.com/help/deeplearning/ref/experimentmanager-app.html#mw_92d8f99c-f283-4bc5-a5d7-7d779c4831f7
It sounds like you discovered the fourth syntax, hopefully without too much pain!
By the way, you may also be interested in this example, since it involves training an LSTM: https://www.mathworks.com/help/deeplearning/ug/exp-mgr-sequence-regression-example.html
Cheers,
Jorge

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by