Troubles with Experiment Manager Setup for LSTM regression (2024)

55 views (last 30 days)

Show older comments

massimo giannini on 10 Aug 2024 at 12:00

  • Link

    Direct link to this question

    https://matlabcentral.mathworks.com/matlabcentral/answers/2144389-troubles-with-experiment-manager-setup-for-lstm-regression

  • Link

    Direct link to this question

    https://matlabcentral.mathworks.com/matlabcentral/answers/2144389-troubles-with-experiment-manager-setup-for-lstm-regression

Commented: massimo giannini on 12 Aug 2024 at 13:31

Accepted Answer: Jaimin

  • dati_net.mat

Open in MATLAB Online

I need help!

I am managing Experiment Manager with a very simple exercise. I use data stocks for one-step ahead of the close price with a simple LSTM net. The net works well with trainnest(XTest,YTest,layers,options). I want to calibrate the Epochs parameters with Experiment Manager. I followed any suggestions and tutorials on the web but I can not do it. Xtest is an array with 6 cols (open, close, volum etc.) and 2401 (time steps) rows for a given stock. The reponse is a single 2401 vector containing one-time shifted of the close price. As said. I have no problem with trainnet and the net performs well.

I put data, layers and options in the script for Experiment Manager. Here is my code:

function [XTrain_N,YTrain_N,layers,options] = Experiment1_setup1(params)

load dati_net.mat XTrain_N YTrain_N

num_features = 6;

num_responses = 1;

num_hidden_units = 350;

layers = [

featureInputLayer(6);

lstmLayer(num_hidden_units, 'OutputMode','last')

fullyConnectedLayer(num_responses)

];

%Training Options

options = trainingOptions("adam", ...

MaxEpochs=params.MaxEpochs, ...

SequencePaddingDirection="left",...

InitialLearnRate=0.001,...

Shuffle="every-epoch", ...

ValidationFrequency=50, ...

GradientThreshold=.93, ...

Verbose=false, ...

Metrics="rmse", ...

Plots="training-progress");

end

But when I run the experiment I always get:

The following errors occurred while running the experiment:

Errors occurred while validating the setup function: Caused by: Invalid output arguments from setup function. Third-from-last output of setup function must be a layer array or dlnetwork object, but a value of type 'double' was detected.

I tried dozens of trials but I am able to escape the problem. I attach also my data

Thanks in Advance!

2 Comments

Show NoneHide None

dpb on 10 Aug 2024 at 16:39

Direct link to this comment

https://matlabcentral.mathworks.com/matlabcentral/answers/2144389-troubles-with-experiment-manager-setup-for-lstm-regression#comment_3234689

  • Link

    Direct link to this comment

    https://matlabcentral.mathworks.com/matlabcentral/answers/2144389-troubles-with-experiment-manager-setup-for-lstm-regression#comment_3234689

The function as shown doesn't return any of the return variables...

massimo giannini on 11 Aug 2024 at 11:44

Direct link to this comment

https://matlabcentral.mathworks.com/matlabcentral/answers/2144389-troubles-with-experiment-manager-setup-for-lstm-regression#comment_3234954

  • Link

    Direct link to this comment

    https://matlabcentral.mathworks.com/matlabcentral/answers/2144389-troubles-with-experiment-manager-setup-for-lstm-regression#comment_3234954

Ok so how can I fix it?

Sign in to comment.

Sign in to answer this question.

Accepted Answer

  • Link

    Direct link to this answer

    https://matlabcentral.mathworks.com/matlabcentral/answers/2144389-troubles-with-experiment-manager-setup-for-lstm-regression#answer_1497794

  • Link

    Direct link to this answer

    https://matlabcentral.mathworks.com/matlabcentral/answers/2144389-troubles-with-experiment-manager-setup-for-lstm-regression#answer_1497794

Edited: Jaimin on 12 Aug 2024 at 10:49

Open in MATLAB Online

Hi @massimo giannini,

According to the issue description, you are able to train your model using thetrainnetfunction. However, when attempting to tune the epoch hyperparameter value using MATLAB's Experiment Manager app, you encounter an error.

One workaround I found is to usetrainNetworkinstead oftrainnetin Experiment Manager. To do this

  1. Click on "New" -> "Project" -> "Blank Project"
  2. Select the 'Built-In Training' experiment from the 'Blank Built-In trainNetwork Experiment' as shown in the image below.Troubles with Experiment Manager Setup for LSTM regression (5)
  3. After selecting that, configure the parameters as shown in the image below. Troubles with Experiment Manager Setup for LSTM regression (6)
  4. Set all other parameters according to requirements.

Additionally, there is a modification in"Experiment1_setup1". Here is the updated code.

function [XTrain_N, YTrain_N, layers, options] = SequenceRegressionExperiment_setup2(params)

load dati_net.mat XTrain_N YTrain_N

num_features = 6;

num_responses = 1;

num_hidden_units = 350;

layers = [

featureInputLayer(6);

lstmLayer(num_hidden_units, 'OutputMode','last')

fullyConnectedLayer(num_responses)

regressionLayer

];

%Training Options

options = trainingOptions("adam", ...

MaxEpochs=params.MaxEpochs, ...

SequencePaddingDirection="left",...

InitialLearnRate=0.001,...

Shuffle="every-epoch", ...

ValidationFrequency=50, ...

GradientThreshold=.93, ...

L2Regularization=0.00001, ...

Verbose=false, ...

Plots="training-progress");

end

I have attached some resources that will be helpful to you.

Difference between “trainnet” and “trainNetwork”: https://www.mathworks.com/matlabcentral/answers/2060029-difference-between-trainnet-and-trainnetwork

Experiment Manager: https://www.mathworks.com/help/deeplearning/ref/experimentmanager-app.html#mw_92d8f99c-f283-4bc5-a5d7-7d779c4831f7

Training Configurations for LSTM: https://www.mathworks.com/help/deeplearning/ug/experiment-with-training-configurations-for-sequence-regression.html

I hope this helps!

1 Comment

Show -1 older commentsHide -1 older comments

massimo giannini on 12 Aug 2024 at 13:31

Direct link to this comment

https://matlabcentral.mathworks.com/matlabcentral/answers/2144389-troubles-with-experiment-manager-setup-for-lstm-regression#comment_3235369

  • Link

    Direct link to this comment

    https://matlabcentral.mathworks.com/matlabcentral/answers/2144389-troubles-with-experiment-manager-setup-for-lstm-regression#comment_3235369

Open in MATLAB Online

Great! Thank you!!

I found a second working alternative yesterday by "try and guess". I converted XTrain_N YTrain_N to a datastore:

load dati_net.mat XTrain_N YTrain_N

adsXTrain = arrayDatastore(XTrain_N);

adsYTrain = arrayDatastore(YTrain_N);

cdsTrain = combine(adsXTrain,adsYTrain);

, erased Metrics from the options and used this string for the function:

function [cdsTrain,layers,lossFcn,options] = Experiment1_setup1(params)

lossFcn="mse";

and now Experiment Manager works.

Anyway thanks for your valuable help

Sign in to comment.

More Answers (0)

Sign in to answer this question.

See Also

Categories

MATLABData Import and AnalysisData Import and ExportStandard File Formats

Find more on Standard File Formats in Help Center and File Exchange

Tags

  • experiment manager

Community Treasure Hunt

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

Start Hunting!

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.


Troubles with Experiment Manager Setup for LSTM regression (8)

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom(English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

Troubles with Experiment Manager Setup for LSTM regression (2024)

References

Top Articles
Remembering Sallie Petteway
All Obituaries | Prospect Memorial Funeral Home | Waterbury CT funeral home and cremation
Funny Roblox Id Codes 2023
Golden Abyss - Chapter 5 - Lunar_Angel
Www.paystubportal.com/7-11 Login
Joi Databas
DPhil Research - List of thesis titles
Shs Games 1V1 Lol
Evil Dead Rise Showtimes Near Massena Movieplex
Steamy Afternoon With Handsome Fernando
Which aspects are important in sales |#1 Prospection
Detroit Lions 50 50
18443168434
Newgate Honda
Zürich Stadion Letzigrund detailed interactive seating plan with seat & row numbers | Sitzplan Saalplan with Sitzplatz & Reihen Nummerierung
Grace Caroline Deepfake
978-0137606801
Nwi Arrests Lake County
Justified Official Series Trailer
London Ups Store
Committees Of Correspondence | Encyclopedia.com
Pizza Hut In Dinuba
Jinx Chapter 24: Release Date, Spoilers & Where To Read - OtakuKart
How Much You Should Be Tipping For Beauty Services - American Beauty Institute
Free Online Games on CrazyGames | Play Now!
Sizewise Stat Login
VERHUURD: Barentszstraat 12 in 'S-Gravenhage 2518 XG: Woonhuis.
Jet Ski Rental Conneaut Lake Pa
Unforeseen Drama: The Tower of Terror’s Mysterious Closure at Walt Disney World
Ups Print Store Near Me
What Time Does Walmart Auto Center Open
Nesb Routing Number
Olivia Maeday
Random Bibleizer
10 Best Places to Go and Things to Know for a Trip to the Hickory M...
Black Lion Backpack And Glider Voucher
Gopher Carts Pensacola Beach
Duke University Transcript Request
Lincoln Financial Field, section 110, row 4, home of Philadelphia Eagles, Temple Owls, page 1
Jambus - Definition, Beispiele, Merkmale, Wirkung
Ark Unlock All Skins Command
Craigslist Red Wing Mn
D3 Boards
Jail View Sumter
Nancy Pazelt Obituary
Birmingham City Schools Clever Login
Thotsbook Com
Funkin' on the Heights
Vci Classified Paducah
Www Pig11 Net
Ty Glass Sentenced
Latest Posts
Article information

Author: Margart Wisoky

Last Updated:

Views: 6340

Rating: 4.8 / 5 (78 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Margart Wisoky

Birthday: 1993-05-13

Address: 2113 Abernathy Knoll, New Tamerafurt, CT 66893-2169

Phone: +25815234346805

Job: Central Developer

Hobby: Machining, Pottery, Rafting, Cosplaying, Jogging, Taekwondo, Scouting

Introduction: My name is Margart Wisoky, I am a gorgeous, shiny, successful, beautiful, adventurous, excited, pleasant person who loves writing and wants to share my knowledge and understanding with you.