-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Enable partial stacking at Batch level #100
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
Conversation
59541f5
to
22e877e
Compare
def1889
to
70bd7e0
Compare
70bd7e0
to
13fc202
Compare
@Trinkle23897 Just for you to know, I'm an engineer and for the first time, and thanks to this PR (and all the previous ones) a real case application is finally running without raising an exception 😆 Perhaps it is time to release 0.2.4 😛 |
Sure and much appreciate~ |
Yes I'll do it now. Could you please tell me what/where to update them and what you have in mind exactly ? |
Yes I know this, but you mean only updating this page https://tianshou.readthedocs.io/en/latest/api/tianshou.data.html ? |
Exactly. I mean that you can add the new feature in https://tianshou.readthedocs.io/en/latest/api/tianshou.data.html#tianshou.data.Batch
also with buffer. |
You can make the documentation show Line 61 in 70aa7bf
For example, add __idiv__ into 'special-members'.And the readthedocs page will be updated only if the master version has been updated. So it is better to preview the documentation in your own local computer. |
b8b2d02
to
aa7775b
Compare
28c20df
to
724fb22
Compare
724fb22
to
8c60d74
Compare
Added missing documentation. It turns out that I didn't modified the behaviour of Buffer by any means, it was only internal modifications, so I have not updated it. |
Could it support slicing method such as |
In practice it shouldn't be very hard, but conceptually Batch is missing the notion of multidimensional samples, for instance only The issue is that |
Adding this property to
Then, NB: You can ping me on the issue/PR if you want a review. |
By the way, it may be good to overload direct assignment to make sure that every list are converted to numpy. Indeed, list are a recurrent issue for slicing, stacking and concatenation, and it introduces many |
* Enable stacking of partially matching Batch instances. * Fix list support for getitem. * Fix Batch 'size' method. * Update Batch documentation.
Allow stacking of inconsistent batches:
Before that, the result was unexpected (no failure and different result depending of Batch order).
As you may notice, I also replaced 'nan' in float array by 0.0, since at the end it is usually meaningful and convenient.
It comes with a slight performance improvement: #96