Skip to content

Commit d4dc6c0

Browse files
SimonBlankefkiraly
andauthored
Small fixes (#179)
Some small fixes and adds an abstract method. --------- Co-authored-by: Franz Király <fkiraly@gcos.ai>
1 parent 0950a7b commit d4dc6c0

3 files changed

Lines changed: 24 additions & 3 deletions

File tree

src/hyperactive/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,3 @@
1313

1414
__version__ = importlib.metadata.version("hyperactive")
1515
__license__ = "MIT"
16-
17-
__all__ = []

src/hyperactive/base/_optimizer.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,26 @@ def solve(self):
8282
best_params = self._solve(experiment, **search_config)
8383
self.best_params_ = best_params
8484
return best_params
85+
86+
def _solve(self, experiment, *args, **kwargs):
87+
"""Run the optimization search process.
88+
89+
Parameters
90+
----------
91+
experiment : BaseExperiment
92+
The experiment to optimize parameters for.
93+
*args : tuple
94+
Positional arguments specific to the optimization backend.
95+
**kwargs : dict
96+
Keyword arguments specific to the optimization backend.
97+
98+
Returns
99+
-------
100+
dict with str keys
101+
The best parameters found during the search.
102+
Must have keys a subset or identical to experiment.paramnames().
103+
"""
104+
raise NotImplementedError(
105+
"abstract method, BaseOptimizer._solve should be implemented by "
106+
"descendant classes"
107+
)

src/hyperactive/opt/random_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Grid search optimizer."""
1+
"""Random search optimizer."""
22

33
# copyright: hyperactive developers, MIT License (see LICENSE file)
44

0 commit comments

Comments
 (0)