google-deepmind / reverb

Reverb is an efficient and easy-to-use data storage and transport system designed for machine learning research
Apache License 2.0
704 stars 92 forks source link

Why does ReplaySample returns a flat list instead of nested structure? #54

Closed thisiscam closed 3 years ago

thisiscam commented 3 years ago

Hi,

I was wondering if there's any particular reason why https://github.com/deepmind/reverb/blob/master/reverb/replay_sample.py#L53 returns a flat list for the python client?

acassirer commented 3 years ago

Hey,

That comment has grown a bit misleading with age. It used to be that the data was always flat but now the data may be structured. If the structure is available to the sampler (either by providing it explicitly or from the Table signature).

I'll update this docstring right away! Thanks for highlighting this!

thisiscam commented 3 years ago

Could you confirm when this behavior changed? Currently I'm using the stable release v0.3.1 on PyPI and it seems to be returning the flat list. For what is worth, I did specified the Table signature when I setup the server.

thisiscam commented 3 years ago

mentioning @acassirer in case GitHub doesn't send notifications for a closed issue. Thanks!

acassirer commented 3 years ago

I don't recommend that the client.sample method is used for anything but debugging so it hasn't received much love. That being said, support for signatures in this method was added two weeks ago in this change and is not present in any stable releases. It also is deactivated by default.

This will be available in the next stable release but that won't happen until tensorflow releases the next version. It is very easy to implement this yourself though by simply copying the behaviour introduced in that change.

thisiscam commented 3 years ago

Thanks for confirming!