unable to control the optimization of some hyperparameters

1 回表示 (過去 30 日間)
muhamed ibrahim
muhamed ibrahim 2022 年 6 月 1 日
編集済み: muhamed ibrahim 2022 年 6 月 1 日
I'm trying to optimize the hyperparmeters (number of layers and number of nodes in each layer) for a Stacked auto encoder as follows:
optimVars = [optimizableVariable('numLayers',[1 3],'Type','integer') % number of layers
optimizableVariable('layer1_Size',[500 1000],'Type','integer') % number of nodes in the first layer
optimizableVariable('layer2_Size',[500 400],'Type','integer') % number of nodes in the 2nd layer
optimizableVariable('layer3_Size',[400 50],'Type','integer') % number of nodes in the 3rd layer
];
but this way I'm facing a problem which is for example: when the optimizer runs an iteration with numbLayers=1, the
optimzer will optimize the last two variables (layer2_Size & layer3_Size) which in such a case are not needed to optimize because
the only variable needs to be optimized in this case is "layer1_Size" . Is there any way to solve this problem by setting a variable on/off depending on another variable value?

回答 (0 件)

カテゴリ

Help Center および File ExchangeProblem-Based Optimization Setup についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by