Skip to content

Commit

Permalink
Add max_suggest_attempts as an attribute
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
  • Loading branch information
lebrice committed Apr 14, 2022
1 parent 619d6d6 commit 872f094
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/orion/core/worker/primary_algo.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def __init__(self, space: Space, algorithm: AlgoType):
original_registry=self.registry,
transformed_registry=self.algorithm.registry,
)
self.max_suggest_attempts = 100

@property
def original_space(self) -> Space:
Expand Down Expand Up @@ -139,9 +140,8 @@ def suggest(self, num: int) -> list[Trial] | None:
"""

trials: list[Trial] = []
max_suggest_attempts = 100

for suggest_attempt in range(1, max_suggest_attempts + 1):
for suggest_attempt in range(1, self.max_suggest_attempts + 1):
transformed_trials: list[Trial] | None = self.algorithm.suggest(num)
transformed_trials = transformed_trials or []

Expand Down

0 comments on commit 872f094

Please sign in to comment.