Is it possible to create an optimizableVariable of integer type as an array with step different from 1?
古いコメントを表示
Hello everyone!
I'm trying to perform a Bayesian optimization to find the best hyperparameters for a deep neural network and I want the variable MiniBatchSize to just have, in this case, three possible values: 8, 10, 12. I thought I could declare optVar as if it was an array
interval = 8:2:12;
optVar = optimizableVariable('MiniBatchSize', interval, 'Type', 'integer');
This code raises the following error:
Error using optimizableVariable/checkRange
'Range' value must be a string array, a cell array of character vectors, or a numeric vector of length 2.
Am I missing something? Is there another way to perform this?
Thanks in advance.
採用された回答
その他の回答 (1 件)
Walter Roberson
2021 年 3 月 6 日
1 投票
Optimization variable 1 to 3 and multiply by 2 and add 6.
3 件のコメント
Jon Gutiérrez Zaballa
2021 年 3 月 6 日
Walter Roberson
2021 年 3 月 6 日
Ah, sorry, I didn't realize that the Stats toolbox had its own kind of variable creation; the instructions I gave were for Problem-Based Optimization
Jon Gutiérrez Zaballa
2021 年 3 月 6 日
カテゴリ
ヘルプ センター および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!