Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structure of ReplayBuffer._storage #610

Closed
FHainzl opened this issue Dec 10, 2019 · 1 comment · Fixed by #629
Closed

Structure of ReplayBuffer._storage #610

FHainzl opened this issue Dec 10, 2019 · 1 comment · Fixed by #629
Labels
documentation Documentation should be updated question Further information is requested

Comments

@FHainzl
Copy link

FHainzl commented Dec 10, 2019

In deepq.ReplayBuffer, the docstring for ReplayBuffer._storage says
[(np.ndarray, float, float, np.ndarray, bool)]
but shouldn't it actually be
"""[(np.ndarray, [float], float, np.ndarray, bool)]?

I think this would be correct for two reasons:

  • Actions could be multi-dimensional
  • The docstring for ReplayBuffer.add claims
    :param action: ([float]) the action,
    which I think is an inconsistency with the storage docstring.

Am I missing something here?

@araffin araffin added documentation Documentation should be updated question Further information is requested labels Dec 10, 2019
@araffin
Copy link
Collaborator

araffin commented Dec 10, 2019

Hello,

Good point.

in fact, it depends on whether the buffer is used with discrete actions (e.g. DQN) or continuous actions (e.g. SAC).

For discrete: action should be int
For continuous: action should be np.ndarray (in fact a numpy array of type float32)

Overall, np.ndarray would be the most correct approximation, feel free to submit a PR that solves this inconsistency ;)

@araffin araffin mentioned this issue Dec 19, 2019
11 tasks
araffin added a commit that referenced this issue Dec 19, 2019
* Bump version

* Add a message to PPO2 assert (closes #625)

* Update replay buffer doctring (closes #610)

* Don't specify a version for pytype

* Fix `VecEnv` docstrings (closes #577)

* Typo

* Re-add python version for pytype
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation should be updated question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants