Skip to content

Commit e466f6e

Browse files
authored
Update the hyperparameter optimization example script (vwxyzjn#268)
* Hyperparameter optimization * add gitignore * pre-commit * quick refactor * Add docs * pre-commit * clarify docs * update docs * push changes * push changes * typo * update dependencies * Quick fix * clarification * Update docs on python version * add test cases * add tests * update config * update test cases * Refactor docs * Patch hyper parameter optimization example
1 parent 25dc24e commit e466f6e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tuner_example.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77
metric="charts/episodic_return",
88
metric_last_n_average_window=50,
99
direction="maximize",
10+
aggregation_type="average",
1011
target_scores={
1112
"CartPole-v1": [0, 500],
1213
"Acrobot-v1": [-500, 0],
1314
},
1415
params_fn=lambda trial: {
1516
"learning-rate": trial.suggest_loguniform("learning-rate", 0.0003, 0.003),
1617
"num-minibatches": trial.suggest_categorical("num-minibatches", [1, 2, 4]),
17-
"update-epochs": trial.suggest_categorical("update-epochs", [1, 2, 4]),
18+
"update-epochs": trial.suggest_categorical("update-epochs", [1, 2, 4, 8]),
1819
"num-steps": trial.suggest_categorical("num-steps", [5, 16, 32, 64, 128]),
1920
"vf-coef": trial.suggest_uniform("vf-coef", 0, 5),
2021
"max-grad-norm": trial.suggest_uniform("max-grad-norm", 0, 5),
21-
"total-timesteps": 10000,
22+
"total-timesteps": 100000,
2223
"num-envs": 16,
2324
},
2425
pruner=optuna.pruners.MedianPruner(n_startup_trials=5),
2526
sampler=optuna.samplers.TPESampler(),
26-
# wandb_kwargs={"project": "cleanrl"},
2727
)
2828
tuner.tune(
29-
num_trials=10,
29+
num_trials=100,
3030
num_seeds=3,
3131
)

0 commit comments

Comments
 (0)