Skip to content

Commit 301c421

Browse files
authored
Hyperparametertuning custom strategies (#325)
Adding default costfunc kwargs to allow LlaMEA to generate algorithms without these settings.
1 parent ad41cfe commit 301c421

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel_tuner/strategies/wrapper.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ def __init__(self, optimizer: OptAlg):
3434
self.optimizer: OptAlg = optimizer
3535

3636
def tune(self, searchspace: Searchspace, runner, tuning_options):
37+
if not hasattr(self.optimizer, 'costfunc_kwargs'):
38+
# Set costfunc kwarts to no scaling and no snapping (assume a mixed-int optimizer).
39+
self.optimizer.costfunc_kwargs = {
40+
"scaling": False,
41+
"snap": False,
42+
}
43+
self.optimizer.constraint_aware = False
3744
cost_func = CostFunc(searchspace, tuning_options, runner, **self.optimizer.costfunc_kwargs)
3845

3946
if self.optimizer.costfunc_kwargs.get('scaling', False):

0 commit comments

Comments
 (0)