Skip to content

Commit

Permalink
Update dqn.py
Browse files Browse the repository at this point in the history
modify to avoid zip error
  • Loading branch information
Wenpu-Wang committed Apr 20, 2022
1 parent a74687a commit bc35b4a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dqn.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ def sample(self, frame_idx, batch_size=20, beta_frames=3000):
action_samples, reward_samples, next_state_samples, done_samples, indices, weights

def update_priorities(self, batch_indices, batch_priorities):
for idx, prio in zip(batch_indices, batch_priorities):
self.priorities[idx] = prio
# for idx, prio in zip(batch_indices, batch_priorities):
# self.priorities[idx] = prio
for idx in batch_indices:
self.priorities[idx] = batch_priorities

def __len__(self):
return self.cnt
Expand Down

0 comments on commit bc35b4a

Please sign in to comment.