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

Add ScaleReward wrapper #304

Merged
merged 7 commits into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Improve comments
  • Loading branch information
muupan committed Oct 5, 2018
commit 5ba9ef1c97895861ec8b5fa400deac3cabd64cb2
3 changes: 2 additions & 1 deletion examples/gym/train_a3c_gym.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def make_env(process_idx, test):
if args.monitor and process_idx == 0:
env = gym.wrappers.Monitor(env, args.outdir)
if not test:
# Scale rewards observed by an agent to facilitate training
# Scale rewards (and thus returns) to a reasonable range so that
# training is easier
env = chainerrl.wrappers.ScaleReward(env, args.reward_scale_factor)
if args.render and process_idx == 0 and not test:
misc.env_modifiers.make_rendered(env)
Expand Down
3 changes: 2 additions & 1 deletion examples/gym/train_acer_gym.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def make_env(process_idx, test):
if args.monitor and process_idx == 0:
env = gym.wrappers.Monitor(env, args.outdir)
if not test:
# Scale rewards observed by an agent to facilitate training
# Scale rewards (and thus returns) to a reasonable range so that
# training is easier
env = chainerrl.wrappers.ScaleReward(env, args.reward_scale_factor)
if args.render and process_idx == 0 and not test:
misc.env_modifiers.make_rendered(env)
Expand Down
3 changes: 2 additions & 1 deletion examples/gym/train_categorical_dqn_gym.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def make_env(test):
if args.monitor:
env = gym.wrappers.Monitor(env, args.outdir)
if not test:
# Scale rewards observed by an agent to facilitate training
# Scale rewards (and thus returns) to a reasonable range so that
# training is easier
env = chainerrl.wrappers.ScaleReward(env, args.reward_scale_factor)
if ((args.render_eval and test) or
(args.render_train and not test)):
Expand Down
3 changes: 2 additions & 1 deletion examples/gym/train_ddpg_gym.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def make_env(test):
if isinstance(env.action_space, spaces.Box):
misc.env_modifiers.make_action_filtered(env, clip_action_filter)
if not test:
# Scale rewards observed by an agent to facilitate training
# Scale rewards (and thus returns) to a reasonable range so that
# training is easier
env = chainerrl.wrappers.ScaleReward(env, args.reward_scale_factor)
if args.render and not test:
misc.env_modifiers.make_rendered(env)
Expand Down
3 changes: 2 additions & 1 deletion examples/gym/train_dqn_gym.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def make_env(test):
if isinstance(env.action_space, spaces.Box):
misc.env_modifiers.make_action_filtered(env, clip_action_filter)
if not test:
# Scale rewards observed by an agent to facilitate training
# Scale rewards (and thus returns) to a reasonable range so that
# training is easier
env = chainerrl.wrappers.ScaleReward(env, args.reward_scale_factor)
if ((args.render_eval and test) or
(args.render_train and not test)):
Expand Down
3 changes: 2 additions & 1 deletion examples/gym/train_pcl_gym.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def make_env(process_idx, test):
if args.monitor and process_idx == 0:
env = gym.wrappers.Monitor(env, args.outdir)
if not test:
# Scale rewards observed by an agent to facilitate training
# Scale rewards (and thus returns) to a reasonable range so that
# training is easier
env = chainerrl.wrappers.ScaleReward(env, args.reward_scale_factor)
if args.render and process_idx == 0 and not test:
misc.env_modifiers.make_rendered(env)
Expand Down
3 changes: 2 additions & 1 deletion examples/gym/train_ppo_gym.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ def make_env(test):
if args.monitor:
env = gym.wrappers.Monitor(env, args.outdir)
if not test:
# Scale rewards observed by an agent to facilitate training
# Scale rewards (and thus returns) to a reasonable range so that
# training is easier
env = chainerrl.wrappers.ScaleReward(env, args.reward_scale_factor)
if args.render:
misc.env_modifiers.make_rendered(env)
Expand Down
3 changes: 2 additions & 1 deletion examples/gym/train_reinforce_gym.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def make_env(test):
if args.monitor:
env = gym.wrappers.Monitor(env, args.outdir)
if not test:
# Scale rewards observed by an agent to facilitate training
# Scale rewards (and thus returns) to a reasonable range so that
# training is easier
env = chainerrl.wrappers.ScaleReward(env, args.reward_scale_factor)
if args.render and not test:
misc.env_modifiers.make_rendered(env)
Expand Down