зеркало из https://github.com/microsoft/MLOS.git
Make sure One Shot Optimizer always returns the same suggestion (#759)
Make sure the `OneShotOptimizer.suggest()` call always returns the same configuration. Changes related to `MockEnv` determinism moved to #769 Closes #755 --------- Co-authored-by: Brian Kroth <bpkroth@users.noreply.github.com>
This commit is contained in:
Родитель
cef476c4c4
Коммит
62d7efb484
|
@ -18,7 +18,7 @@ _LOG = logging.getLogger(__name__)
|
|||
|
||||
class OneShotOptimizer(MockOptimizer):
|
||||
"""
|
||||
Mock optimizer that proposes a single configuration and returns.
|
||||
No-op optimizer that proposes a single configuration and returns.
|
||||
Explicit configs (partial or full) are possible using configuration files.
|
||||
"""
|
||||
|
||||
|
@ -33,6 +33,14 @@ class OneShotOptimizer(MockOptimizer):
|
|||
_LOG.info("Run a single iteration for: %s", self._tunables)
|
||||
self._max_iter = 1 # Always run for just one iteration.
|
||||
|
||||
def suggest(self) -> TunableGroups:
|
||||
"""
|
||||
Always produce the same (initial) suggestion.
|
||||
"""
|
||||
tunables = super().suggest()
|
||||
self._start_with_defaults = True
|
||||
return tunables
|
||||
|
||||
@property
|
||||
def supports_preload(self) -> bool:
|
||||
return False
|
||||
|
|
Загрузка…
Ссылка в новой задаче