Skip to content

Commit 2dc2bae

Browse files
committed
update comment of callbacks
1 parent 558ad6d commit 2dc2bae

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

examples/cartpole/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To train with [Dual-clip PPO](https://arxiv.org/abs/1912.09729):
1313
python train_ppo.py --config dual_clip_ppo.yaml
1414
```
1515

16-
If you want to save checkpoints, try to train with Callbacks:
16+
If you want to evaluate the agent during training and save the best model and save checkpoints, try to train with callbacks:
1717

1818
```shell
1919
python train_ppo.py --config callbacks.yaml

examples/cartpole/callbacks.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
callbacks:
22
- id: "CheckpointCallback"
33
args: {
4-
"save_freq": 500,
5-
"save_path": "./results/checkpoints/",
6-
"name_prefix": "ppo",
7-
"save_replay_buffer": True
4+
"save_freq": 500, # how often to save the model
5+
"save_path": "./results/checkpoints/", # where to save the model
6+
"name_prefix": "ppo", # the prefix of the saved model
7+
"save_replay_buffer": True # not work yet
88
}
99
- id: "EvalCallback"
1010
args: {
11-
"eval_env": {"id": "CartPole-v1","env_num":4},
12-
"n_eval_episodes": 4,
13-
"eval_freq":500,
14-
"log_path": "./results/eval_log_path",
15-
"best_model_save_path": "./results/best_model/",
16-
"deterministic": True,
17-
"render": True,
18-
"asynchronous": True,
11+
"eval_env": {"id": "CartPole-v1","env_num":4}, # how many envs to set up for evaluation
12+
"n_eval_episodes": 4, # how many episodes to run for each evaluation
13+
"eval_freq": 500, # how often to run evaluation
14+
"log_path": "./results/eval_log_path", # where to save the evaluation results
15+
"best_model_save_path": "./results/best_model/", # where to save the best model
16+
"deterministic": True, # whether to use deterministic action
17+
"render": True, # whether to render the env
18+
"asynchronous": True, # whether to run evaluation asynchronously
1919
}

0 commit comments

Comments
 (0)