Remove unused variables

This commit is contained in:
Shangtong Zhang
2018-04-12 22:04:56 -06:00
parent f255c6ed25
commit de478faf9b
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ class A2CAgent(BaseAgent):
config = self.config
rollout = []
states = self.states
for i in range(config.rollout_length):
for _ in range(config.rollout_length):
prob, log_prob, value = self.network.predict(config.state_normalizer(states))
actions = [self.policy.sample(p) for p in prob.data.cpu().numpy()]
next_states, rewards, terminals, _ = self.task.step(actions)
+1 -1
View File
@@ -34,7 +34,7 @@ class NStepDQNAgent(BaseAgent):
config = self.config
rollout = []
states = self.states
for i in range(config.rollout_length):
for _ in range(config.rollout_length):
q = self.network.predict(self.config.state_normalizer(states))
actions = [self.policy.sample(v) for v in q.data.cpu().numpy()]
next_states, rewards, terminals, _ = self.task.step(actions)
+1 -1
View File
@@ -30,7 +30,7 @@ class PPOAgent(BaseAgent):
config = self.config
rollout = []
states = self.states
for i in range(config.rollout_length):
for _ in range(config.rollout_length):
actions, log_probs, _, values = self.network.predict(states)
next_states, rewards, terminals, _ = self.task.step(actions.data.cpu().numpy())
self.episode_rewards += rewards