Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
albertbou92 committed Nov 27, 2023
1 parent 9a06db6 commit 2361765
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions examples/ppo/ppo_mujoco.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@ def main(cfg: "DictConfig"): # noqa: F821
"train/lr": alpha * cfg_optim_lr,
"train/sampling_time": sampling_time,
"train/training_time": training_time,
"train/clip_epsilon": alpha * cfg_loss_clip_epsilon if
cfg_loss_anneal_clip_eps else cfg_loss_clip_epsilon,
"train/clip_epsilon": alpha * cfg_loss_clip_epsilon
if cfg_loss_anneal_clip_eps
else cfg_loss_clip_epsilon,
}
)

Expand Down
5 changes: 4 additions & 1 deletion examples/ppo/utils_mujoco.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# Environment utils
# --------------------------------------------------------------------


def make_env(env_name="HalfCheetah-v4", device="cpu"):
env = GymEnv(env_name, device=device)
env = TransformedEnv(env)
Expand Down Expand Up @@ -71,7 +72,9 @@ def make_ppo_models_state(proof_environment):
# Add state-independent normal scale
policy_mlp = torch.nn.Sequential(
policy_mlp,
AddStateIndependentNormalScale(proof_environment.action_spec.shape[-1], scale_lb=1e-8)
AddStateIndependentNormalScale(
proof_environment.action_spec.shape[-1], scale_lb=1e-8
),
)

# Add probabilistic sampling of the actions
Expand Down

0 comments on commit 2361765

Please sign in to comment.