Skip to content

Commit b7c948f

Browse files
jkterry1araffin
andauthored
Forward verbose status to tuning optimization (#214)
* forward verbose status to tuning optimization * Update exp_manager.py * Update changelog and add comment Co-authored-by: Antonin Raffin <[email protected]>
1 parent 8e3744d commit b7c948f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Support experiment tracking via Weights and Biases (@vwxyzjn)
88

99
### New Features
10+
- Verbose mode for each trial (when doing hyperparam optimization) can now be activated using the debug mode (verbose == 2)
1011

1112
### Bug fixes
1213
- Policies saved during during optimization with distributed Optuna load on new systems (@jkterry)
@@ -16,7 +17,6 @@
1617

1718
### Other
1819

19-
2020
## Release 1.4.0 (2022-01-19)
2121

2222
### Breaking Changes

utils/exp_manager.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -628,12 +628,20 @@ def objective(self, trial: optuna.Trial) -> float:
628628
n_envs = 1 if self.algo == "ars" else self.n_envs
629629
env = self.create_envs(n_envs, no_log=True)
630630

631+
# By default, do not activate verbose output to keep
632+
# stdout clean with only the trials results
633+
trial_verbosity = 0
634+
# Activate verbose mode for the trial in debug mode
635+
# See PR #214
636+
if self.verbose >= 2:
637+
trial_verbosity = self.verbose
638+
631639
model = ALGOS[self.algo](
632640
env=env,
633641
tensorboard_log=None,
634642
# We do not seed the trial
635643
seed=None,
636-
verbose=0,
644+
verbose=trial_verbosity,
637645
**kwargs,
638646
)
639647

0 commit comments

Comments
 (0)