Skip to content

Commit

Permalink
[brief] Allow the Optuna plugin to stop if the trial number exceeds t…
Browse files Browse the repository at this point in the history
…he count

[detailed]
- Mainly to allow the case where the number of trials has already
  exceeded the total count.
  • Loading branch information
marovira committed Nov 5, 2024
1 parent 0097924 commit 3c2f77b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helios/plugins/optuna.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def setup(self) -> None:
"in distributed mode"
)

if self._num_trials is not None and self.trial.number == (self._num_trials - 1):
if self._num_trials is not None and self.trial.number >= (self._num_trials - 1):
self.trial.study.stop()

def on_validation_end(self, validation_cycle: int) -> None:
Expand Down

0 comments on commit 3c2f77b

Please sign in to comment.