Going from trainNetwork to trainnet

조회 수: 4 (최근 30일)
psousa
psousa 2024년 11월 21일
댓글: psousa 2025년 1월 28일
I've attached 3 files(see post below for latest version of these files):
  • trainNetworkEXAMPLE - my original trainNetwork implementation
  • trainnetEXAMPLE - the trainnet implementation
  • example.csv - data file with predictors and targets
The codes for the two examples are identical, the difference is only in the formatting of the input matrices.
trainNetworkEXAMPLE works as expected.
trainnetEXAMPLE works but convergence of the solver is different and solution is poor.
Both codes end with:
Training stopped: Met validation criterion
What am I getting wrong?
  댓글 수: 2
Matt J
Matt J 2024년 11월 21일
Seemingly nothing. Why do you think something is wrong?
psousa
psousa 2024년 11월 21일
NMSE for training set and test set are considerably worse for version using trainnet.

댓글을 달려면 로그인하십시오.

채택된 답변

Sourabh
Sourabh 2025년 1월 28일
편집: Sourabh 2025년 1월 28일
I too encountered the similar issue when using “trainnet” and “trainNetwork” method.
The workaround that worked in my case was to:
  1. Use @mse as the loss function instead of "mse" in “trainnet”.
[net,info] = trainnet(XTrain,TTrain,layers,@mse,options);
2. Set 'GradientThreshold' to ‘Inf’ in ‘trainingOptions’ of both the programs.
options = trainingOptions('adam',
...
'GradientThreshold',Inf,
...
);
Kindly refer to the below image:
  댓글 수: 1
psousa
psousa 2025년 1월 28일
Matlab support got back to me within a couple weeks and that was the solution they offered.
Thanks for looking into it.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

태그

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by