[BUG] Double Initialization of Priority for New Samples in PrioritizedSampler #2211
Closed
3 tasks done
Labels
bug
Something isn't working
Describe the bug
This issue comes from the original issue #2205.
When
ReplayBuffer._add()
is called, the following sequence occurs:(1)
_writer.add() -> _storage.__setitem__() -> buffer.mark_update() -> _sampler.mark_update() -> _sampler.update_priority()
(2)
_sampler.add() -> _sampler._add_or_extend()
Both
_sampler._add_or_extend()
and_sampler.update_priority()
update the priority, withupdate_priority()
even applying additional transformations (e.g.,torch.pow(priority + self._eps, self._alpha)
). This behavior is also present inReplayBuffer._extend()
.This behavior is not reasonable. I believe the
mark_update
mechanism is somewhat redundant. We do not need to ensure that_attached_entities
are updated when changingstorage
content. Any additional updates required after directly modifying_storage
should be the responsibility of the user.mark_update
can lead to redundant calls and even cause conflicts.Additional context
See discussion in the original issue #2205.
Checklist
The text was updated successfully, but these errors were encountered: