Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
modify update_priorities to avoid zip error
  • Loading branch information
Wenpu-Wang committed Apr 20, 2022
1 parent a74687a commit c6a0ae6
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

1 comment on commit c6a0ae6

@SuperbTUM
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you trying to assign a whole batch of prioritizes to each index?

Please sign in to comment.