Working with LSTM and Bayes Optimization

조회 수: 13 (최근 30일)
CHRISTOPHER MILLAR
CHRISTOPHER MILLAR 2020년 2월 25일
댓글: CHRISTOPHER MILLAR 2021년 10월 5일
I am trying to use bayesoptimization to tune the parameters
optimvars = [
optimizableVariable('InitialLearnRate',[1e-2 1],'Transform','log')
optimizableVariable('L2Regularization',[1e-10 1e-2],'Transform','log')];
layers = [ ...
sequenceInputLayer(inputSize,'Normalization','zscore')
bilstmLayer(numHiddenUnits,'OutputMode','last')
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer];
maxEpochs =25;
options = trainingOptions('adam',...
'ExecutionEnvironment','cpu',...
'GradientThreshold',1,...
'MaxEpochs',maxEpochs,...
'MiniBatchSize',miniBatchSize, ...
'SequenceLength', 'longest', ...
'Shuffle','every-epoch', ...
'Verbose', 1, ...
'InitialLearnRate',optimvars.InitialLearnRate,...
'L2Regularization',optimvars.L2Regularization,...
'Plots','training-progress');
objFcn = makeObj(Xtrain,YTrain);
bayesObj = bayesopt(objFcn,optimvars, ...
'MaxTime', 14*60*60, ...
'IsObjectiveDeterministic',false,...
'UseParallel',false);
Where am i going wrong as i get the following error:
Unrecognized method, property, or field 'InitialLearnRate' for class 'optimizableVariable'.
Error in AllVsIndx (line 236)
'InitialLearnRate',optimvars.InitialLearnRate,...
The documentation regarding bayesian optimization is very vague especially when it comes to implementation with LSTM networks
Any help would be appreciated
Thanks

채택된 답변

Jorge Calvo
Jorge Calvo 2021년 5월 27일
If you have R2020b or later, you can use the Experiment Manager app to run Bayesian optimization to determine the best combination of hyperparameters. For more information, see https://www.mathworks.com/help/deeplearning/ug/experiment-using-bayesian-optimization.html.
  댓글 수: 1
CHRISTOPHER MILLAR
CHRISTOPHER MILLAR 2021년 5월 27일
Thanks Jorge
I have just installed R2021a on my machine and will take advantage of this new app

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

추가 답변 (2개)

Don Mathis
Don Mathis 2020년 2월 25일

Jorge Calvo
Jorge Calvo 2021년 10월 5일
I thought you would like to know that, in R2021b, we are included an example for training long short-term memory (LSTM) networks using Bayesian optimization in Experiment Manager:
I hope you find it helpful!
  댓글 수: 1
CHRISTOPHER MILLAR
CHRISTOPHER MILLAR 2021년 10월 5일
Hi jorge,
Yes I have been using it and it makes the optimization process very easy to use.
Thanks for updating the thread with this information.
Regards
Chris

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

카테고리

Help CenterFile Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by