Skip to content

Commit 015a26f

Browse files
committed
params
1 parent 4173725 commit 015a26f

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/hyperactive/opt/gridsearch/_sk.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def _check_param_grid(self, param_grid):
140140
"to be a non-empty sequence."
141141
)
142142

143-
def _run(self, experiment, param_grid, error_score):
143+
def _run(self, experiment, param_grid, error_score, backend, backend_params):
144144
"""Run the optimization search process."""
145145
self._check_param_grid(param_grid)
146146
candidate_params = list(ParameterGrid(param_grid))
@@ -154,8 +154,8 @@ def _run(self, experiment, param_grid, error_score):
154154
fun=_score_params,
155155
iter=candidate_params,
156156
meta=meta,
157-
backend=self.backend,
158-
backend_params=self.backend_params,
157+
backend=backend,
158+
backend_params=backend_params,
159159
)
160160

161161
best_index = np.argmin(scores)

src/hyperactive/opt/random_search.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ def _run(
143143
n_iter,
144144
random_state,
145145
error_score,
146+
backend,
147+
backend_params,
146148
):
147149
"""Sample ``n_iter`` points and return the best parameter set."""
148150
self._check_param_distributions(param_distributions)
@@ -163,8 +165,8 @@ def _run(
163165
fun=_score_params,
164166
iter=candidate_params,
165167
meta=meta,
166-
backend=self.backend,
167-
backend_params=self.backend_params,
168+
backend=backend,
169+
backend_params=backend_params,
168170
)
169171

170172
best_index = int(np.argmin(scores)) # lower-is-better convention

0 commit comments

Comments
 (0)