From 64376aabb07d668573bf63399e3cafc8ee663e9c Mon Sep 17 00:00:00 2001 From: Nikhil Barhate Date: Thu, 26 Sep 2019 16:46:13 +0530 Subject: [PATCH] policy init bug fix #10 --- PPO_continuous.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PPO_continuous.py b/PPO_continuous.py index 76ea7a1..af292b0 100644 --- a/PPO_continuous.py +++ b/PPO_continuous.py @@ -84,7 +84,9 @@ def __init__(self, state_dim, action_dim, action_std, lr, betas, gamma, K_epochs self.policy = ActorCritic(state_dim, action_dim, action_std).to(device) self.optimizer = torch.optim.Adam(self.policy.parameters(), lr=lr, betas=betas) + self.policy_old = ActorCritic(state_dim, action_dim, action_std).to(device) + self.policy_old.load_state_dict(self.policy.state_dict()) self.MseLoss = nn.MSELoss()