Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Replace RewardClipping with SignTransform in Atari examples #1870

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update examples
  • Loading branch information
albertbou92 committed Feb 4, 2024
commit d76f6cff68829221940ae297359684b31f2b2b09
4 changes: 2 additions & 2 deletions examples/a2c/utils_atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
NoopResetEnv,
ParallelEnv,
Resize,
RewardClipping,
RewardSum,
SignTransform,
StepCounter,
ToTensorImage,
TransformedEnv,
Expand Down Expand Up @@ -73,7 +73,7 @@ def make_parallel_env(env_name, num_envs, device, is_test=False):
env.append_transform(RewardSum())
env.append_transform(StepCounter(max_steps=4500))
if not is_test:
env.append_transform(RewardClipping(-1, 1))
env.append_transform(SignTransform(in_keys=["reward"]))
env.append_transform(DoubleToFloat())
env.append_transform(VecNorm(in_keys=["pixels"]))
return env
Expand Down
4 changes: 2 additions & 2 deletions examples/dqn/utils_atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
GymEnv,
NoopResetEnv,
Resize,
RewardClipping,
RewardSum,
SignTransform,
StepCounter,
ToTensorImage,
TransformedEnv,
Expand All @@ -42,7 +42,7 @@ def make_env(env_name, frame_skip, device, is_test=False):
env.append_transform(NoopResetEnv(noops=30, random=True))
if not is_test:
env.append_transform(EndOfLifeTransform())
env.append_transform(RewardClipping(-1, 1))
env.append_transform(SignTransform(in_keys=["reward"]))
env.append_transform(ToTensorImage())
env.append_transform(GrayScale())
env.append_transform(Resize(84, 84))
Expand Down
4 changes: 2 additions & 2 deletions examples/impala/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
GymEnv,
NoopResetEnv,
Resize,
RewardClipping,
RewardSum,
SignTransform,
StepCounter,
ToTensorImage,
TransformedEnv,
Expand Down Expand Up @@ -46,7 +46,7 @@ def make_env(env_name, device, is_test=False):
env.append_transform(NoopResetEnv(noops=30, random=True))
if not is_test:
env.append_transform(EndOfLifeTransform())
env.append_transform(RewardClipping(-1, 1))
env.append_transform(SignTransform(in_keys=["reward"]))
env.append_transform(ToTensorImage(from_int=False))
env.append_transform(GrayScale())
env.append_transform(Resize(84, 84))
Expand Down
4 changes: 2 additions & 2 deletions examples/ppo/utils_atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
NoopResetEnv,
ParallelEnv,
Resize,
RewardClipping,
RewardSum,
SignTransform,
StepCounter,
ToTensorImage,
TransformedEnv,
Expand Down Expand Up @@ -71,7 +71,7 @@ def make_parallel_env(env_name, num_envs, device, is_test=False):
env.append_transform(RewardSum())
env.append_transform(StepCounter(max_steps=4500))
if not is_test:
env.append_transform(RewardClipping(-1, 1))
env.append_transform(SignTransform(in_keys=["reward"]))
env.append_transform(DoubleToFloat())
env.append_transform(VecNorm(in_keys=["pixels"]))
return env
Expand Down
Loading