Skip to content

Commit 72b615b

Browse files
committed
Implemented passing arguments to costfunc from optimizer in OptAlgWrapper
1 parent 8f3744d commit 72b615b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

kernel_tuner/strategies/wrapper.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@
88
class OptAlgWrapper:
99
"""Wrapper class for user-defined optimization algorithms"""
1010

11-
def __init__(self, optimizer, scaling=True):
11+
def __init__(self, optimizer):
1212
self.optimizer = optimizer
13-
self.scaling = scaling
1413

1514

1615
def tune(self, searchspace: Searchspace, runner, tuning_options):
17-
cost_func = CostFunc(searchspace, tuning_options, runner, scaling=self.scaling)
16+
cost_func = CostFunc(searchspace, tuning_options, runner, **self.optimizer.costfunc_kwargs)
1817

19-
if self.scaling:
18+
if self.optimizer.costfunc_kwargs.get('scaling', True):
2019
# Initialize costfunc for scaling
2120
cost_func.get_bounds_x0_eps()
2221

0 commit comments

Comments
 (0)