Skip to content

[Feature Request] Replay Buffer features #994

Closed
@matteobettini

Description

@matteobettini

Hello,

I was playing around with the replay buffers and found some behaviors which resulted surprising for me and was wondering what is the reasoning for this.

  1. when I call buffer.sample(batch_size) it says it is deprected and the correct way is to set the batch_size upon init. But what if I want to change the size of my batch sample at every call?
  2. when i use sampling without replacement I can keep calling buffer.sample() forever, without any error being thrown. How do I know when I'm out of data? what data am I getting when I am out of data?

These are the main two issues I faced in my code.

More generally I would like not to commit at init time to a specific batch_size or replacement stratedy.
I would like at every call to sample() to decide how many sample to receive and if I want to use replacement. and an error to be thrown or a sample of size 0 to be given in case I am out of data.

Metadata

Metadata

Assignees

Labels

Good first issueA good way to start hacking torchrl!enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions