-
Notifications
You must be signed in to change notification settings - Fork 14
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
How to load saved buffer properly? #47
Comments
Thanks for the question! The proper way to load experience from a Vault into a buffer state is to use the "buffer.add" function. For example, this notebook uses In your case, "new_experience" would be the experience loaded from the Vault. Please let me know if you have further questions! |
Hey @4ku & @lbeyers! Sorry for not taking a look at this sooner :) As Louise mentioned, you can load the Vault state using an It seems that the problem above is actually the number of timesteps in the loaded state—is that correct, @4ku? If so: indeed, Vault writes to disk the timesteps up to the Previously, I was thinking about having this functionality though—perhaps we know how many timesteps we want in the flashbax buffer state, even if the vault is smaller than that. I think it should be a pretty simple change—e.g. we could use the flashbax/flashbax/vault/vault.py Lines 461 to 463 in 1352bfa
Currently, if you ask for more timesteps than available (e.g. as in the original post, I ask for a buffer size of 100_000 but the vault only has 500 transitions), it breaks—oops 😂 But this could easily be fixed, and I think is a nice way to use the current API to achieve the desired functionality. Haven't had a chance to give this a proper look but let me know if I have understood you correctly. Happy to draft something when I get a moment, probably sometime this week. Thanks! |
@callumtilbury Yeah, you are right. The actual problem is a number of timesteps in the loaded state.
And state will have size 100_000 with first 500 transitions from vault. |
Also I think current_index shouldn't be 0 (or here should be extra parameter). I want to continue to add transitions to the end of loaded state. |
I tried:
experience_structure
of loadedstate
doesn't match withself.state
. For example, if there are 500 transitions stored in the buffer via vault, the loadedstate
size will be 500, but I initialized the buffer with size 100_000.The text was updated successfully, but these errors were encountered: