-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Advanced Batch slicing & minor fix of RNN support #106
Conversation
@duburcqa I add as what you said, but it turns out that it is not compatible with tests in Some issues:
One more thing: ListReplayBuffer use list instead of np.ndarray. To entirely change list to np.ndarray, this class should be abandoned, which will related to #105 ? |
tianshou/tianshou/data/collector.py Lines 203 to 204 in c639446
I haven't figured it out the best practice to make it compatible with _create_value (None issue). Maybe we should create batch.zero_() ?
|
Yes it would be nice, or rather |
How about these issue? |
True. It should be replaced by |
Yes, and I think it is a good thing to better control the data added to Batch instances or modified. |
I think it is related to |
Good point. I don't know how to handle this, but it is only used by
by simply
|
I found an interesting fact: if self._meta.__dict__.get(name, None) is None:
self._meta.__dict__[name] = []
self._meta.__dict__[name].append(inst) this will bypass both of the |
Why did you use @staticmethod in Batch.stack, @classmethod in Batch.cat? |
Yes, but in fact it would be better if we could use
No reason, |
@duburcqa It should be ready now. Please have a code review at your convenience. |
Very good job ! Still 2 comments to address 😁 |
I was thinking |
By the way, did you do some profiling to check the performances ? |
On my computer, it is the same as the last commit. However, GitHub shows that after the third commit of this PR, it shows down to some degree. I think maybe it is because of slicing: every time the |
I'd like to merge because I have other things to do (two projects and one deadline tomorrow). You can create a new PR to adapt your thought, and I can make a code review for you :) Something to do:
|
* add shape property and modify __getitem__ * change Batch.size to Batch.shape * setattr * Batch.empty * remove scalar in advanced slicing * modify empty_ and __getitem__ * missing testcase * fix empty
Related to #104