Working with LSTM and Bayes Optimization
    11 次查看(过去 30 天)
  
       显示 更早的评论
    
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
0 个评论
采纳的回答
  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.
更多回答(2 个)
  Don Mathis
    
 2020-2-25
        You might find this similar example useful: https://www.mathworks.com/matlabcentral/answers/457788-lstm-time-series-hyperparameter-optimization-using-bayesian-optimization?s_tid=answers_rc1-2_p2_MLT
0 个评论
  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!
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


