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!