Skip to content

Commit

Permalink
Feature/atari wrapper (#92)
Browse files Browse the repository at this point in the history
* implement wrapper

* update config and default value

* fix minor

* Update conftest.py

* update wrapper code

* 🎨 Format Python code with psf/black (#95)

Co-authored-by: ramanuzan <ramanuzan@users.noreply.github.com>

* update skip frame buffer

* update log file name %Y%m%d%H%M%S -> %Y%m%d%H%M%S%f

* update denominator

* update config

* update fire reset assertion

* apply black

Co-authored-by: root <root@gpu-cloud-vnode53.dakao.io>
Co-authored-by: root <root@brain-cluster-gpu9.dakao.io>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ramanuzan <ramanuzan@users.noreply.github.com>
Co-authored-by: root <root@gpu-cloud-node5.dakao.io>
  • Loading branch information
6 people authored Jan 3, 2022
1 parent 24f1c5a commit e70f9e3
Show file tree
Hide file tree
Showing 79 changed files with 274 additions and 172 deletions.
5 changes: 3 additions & 2 deletions jorldy/config/ape_x/atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"img_width": 84,
"img_height": 84,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
"dead_penalty": True,
"episodic_life": True,
}

agent = {
Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/ape_x/pong_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Ape-X Pong_ML-Agents Config ###

env = {"name": "pong_mlagent", "train_mode": True}
env = {"name": "pong_mlagent", "time_scale": 12.0}

agent = {
"name": "ape_x",
Expand Down
3 changes: 2 additions & 1 deletion jorldy/config/ape_x/procgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"render": False,
"gray_img": True,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
}

Expand Down
5 changes: 3 additions & 2 deletions jorldy/config/c51/atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"img_width": 84,
"img_height": 84,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
"dead_penalty": True,
"episodic_life": True,
}

agent = {
Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/c51/pong_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### C51 Pong_ML-Agents Config ###

env = {"name": "pong_mlagent", "train_mode": True}
env = {"name": "pong_mlagent", "time_scale": 12.0}

agent = {
"name": "c51",
Expand Down
3 changes: 2 additions & 1 deletion jorldy/config/c51/procgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"render": False,
"gray_img": True,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
}

Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/ddpg/hopper_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### DDPG Hopper Config ###

env = {"name": "hopper_mlagent", "train_mode": True}
env = {"name": "hopper_mlagent", "time_scale": 12.0}

agent = {
"name": "ddpg",
Expand Down
5 changes: 3 additions & 2 deletions jorldy/config/double/atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"img_width": 84,
"img_height": 84,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
"dead_penalty": True,
"episodic_life": True,
}

agent = {
Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/double/pong_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Double DQN Pong MLAgent Config ###

env = {"name": "pong_mlagent", "train_mode": True}
env = {"name": "pong_mlagent", "time_scale": 12.0}

agent = {
"name": "double",
Expand Down
3 changes: 2 additions & 1 deletion jorldy/config/double/procgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"render": False,
"gray_img": True,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
}

Expand Down
13 changes: 7 additions & 6 deletions jorldy/config/dqn/atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"img_width": 84,
"img_height": 84,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
"dead_penalty": True,
"episodic_life": True,
}

agent = {
Expand All @@ -27,19 +28,19 @@
}

optim = {
"name": "rmsprop",
"lr": 2.5e-4,
"name": "adam",
"lr": 1e-4,
}

train = {
"training": True,
"load_path": None,
"run_step": 30000000,
"run_step": 10000000,
"print_period": 10000,
"save_period": 100000,
"eval_iteration": 5,
"record": True,
"record_period": 300000,
"record_period": 500000,
# distributed setting
"update_period": 32,
"num_workers": 16,
Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/dqn/pong_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### DQN Pong_ML-Agents Config ###

env = {"name": "pong_mlagent", "train_mode": True}
env = {"name": "pong_mlagent", "time_scale": 12.0}

agent = {
"name": "dqn",
Expand Down
3 changes: 2 additions & 1 deletion jorldy/config/dqn/procgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"render": False,
"gray_img": True,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
}

Expand Down
5 changes: 3 additions & 2 deletions jorldy/config/dueling/atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"img_width": 84,
"img_height": 84,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
"dead_penalty": True,
"episodic_life": True,
}

agent = {
Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/dueling/pong_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Dueling DQN Pong_ML-Agents Config ###

env = {"name": "pong_mlagent", "train_mode": True}
env = {"name": "pong_mlagent", "time_scale": 12.0}

agent = {
"name": "dueling",
Expand Down
3 changes: 2 additions & 1 deletion jorldy/config/dueling/procgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"render": False,
"gray_img": True,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
}

Expand Down
5 changes: 3 additions & 2 deletions jorldy/config/icm_ppo/atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"img_width": 84,
"img_height": 84,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
"dead_penalty": True,
"episodic_life": True,
}

agent = {
Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/icm_ppo/drone_delivery_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### ICM PPO Drone Delivery Config ###

env = {"name": "drone_delivery_mlagent", "train_mode": True}
env = {"name": "drone_delivery_mlagent", "time_scale": 12.0}

agent = {
"name": "icm_ppo",
Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/icm_ppo/pong_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### ICM PPO Pong_ML-Agents Config ###

env = {"name": "pong_mlagent", "train_mode": True}
env = {"name": "pong_mlagent", "time_scale": 12.0}

agent = {
"name": "icm_ppo",
Expand Down
3 changes: 2 additions & 1 deletion jorldy/config/icm_ppo/procgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"render": False,
"gray_img": True,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
}

Expand Down
5 changes: 3 additions & 2 deletions jorldy/config/icm_ppo/super_mario_bros.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"img_width": 84,
"img_height": 84,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
"dead_penalty": True,
"episodic_life": True,
}

agent = {
Expand Down
5 changes: 3 additions & 2 deletions jorldy/config/iqn/atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"img_width": 84,
"img_height": 84,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
"dead_penalty": True,
"episodic_life": True,
}

agent = {
Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/iqn/pong_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### IQN Pong_ML-Agents Config ###

env = {"name": "pong_mlagent", "train_mode": True}
env = {"name": "pong_mlagent", "time_scale": 12.0}

agent = {
"name": "iqn",
Expand Down
3 changes: 2 additions & 1 deletion jorldy/config/iqn/procgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"render": False,
"gray_img": True,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
}

Expand Down
5 changes: 3 additions & 2 deletions jorldy/config/m_dqn/atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"img_height": 84,
"stack_frame": 4,
"no_op": True,
"reward_clip": False,
"dead_penalty": False,
"skip_frame": 4,
"reward_clip": True,
"episodic_life": True,
}

agent = {
Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/m_dqn/pong_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Munchausen DQN Pong_ML-Agents Config ###

env = {"name": "pong_mlagent", "train_mode": True}
env = {"name": "pong_mlagent", "time_scale": 12.0}

agent = {
"name": "m_dqn",
Expand Down
3 changes: 2 additions & 1 deletion jorldy/config/m_dqn/procgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"render": False,
"gray_img": True,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
}

Expand Down
5 changes: 3 additions & 2 deletions jorldy/config/m_iqn/atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"img_width": 84,
"img_height": 84,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
"dead_penalty": True,
"episodic_life": True,
}

agent = {
Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/m_iqn/pong_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Munchausen IQN Pong_ML-Agents Config ###

env = {"name": "pong_mlagent", "train_mode": True}
env = {"name": "pong_mlagent", "time_scale": 12.0}

agent = {
"name": "m_iqn",
Expand Down
3 changes: 2 additions & 1 deletion jorldy/config/m_iqn/procgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"render": False,
"gray_img": True,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
}

Expand Down
5 changes: 3 additions & 2 deletions jorldy/config/mpo/atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"img_width": 84,
"img_height": 84,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
"dead_penalty": True,
"episodic_life": True,
}

agent = {
Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/mpo/drone_delivery_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### MPO Drone Delivery Config ###

env = {"name": "drone_delivery_mlagent", "train_mode": True}
env = {"name": "drone_delivery_mlagent", "time_scale": 12.0}

agent = {
"name": "mpo",
Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/mpo/hopper_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### MPO Hopper Config ###

env = {"name": "hopper_mlagent", "train_mode": True}
env = {"name": "hopper_mlagent", "time_scale": 12.0}

agent = {
"name": "mpo",
Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/mpo/pong_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### MPO Pong_ML-Agents Config ###

env = {"name": "pong_mlagent", "train_mode": True}
env = {"name": "pong_mlagent", "time_scale": 12.0}

agent = {
"name": "mpo",
Expand Down
3 changes: 2 additions & 1 deletion jorldy/config/mpo/procgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"render": False,
"gray_img": True,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
}

Expand Down
5 changes: 3 additions & 2 deletions jorldy/config/multistep/atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"img_width": 84,
"img_height": 84,
"stack_frame": 4,
"no_op": False,
"no_op": True,
"skip_frame": 4,
"reward_clip": True,
"dead_penalty": True,
"episodic_life": True,
}

agent = {
Expand Down
2 changes: 1 addition & 1 deletion jorldy/config/multistep/pong_mlagent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Multistep DQN Pong_ML-Agents Config ###

env = {"name": "pong_mlagent", "train_mode": True}
env = {"name": "pong_mlagent", "time_scale": 12.0}

agent = {
"name": "multistep",
Expand Down
Loading

0 comments on commit e70f9e3

Please sign in to comment.