mirror of
https://github.com/wassname/DeepRL.git
synced 2026-09-09 11:13:47 +08:00
Remove unused variables
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user