-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix bug in normalize to avoid divide by zero #239
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
@alexander-soare I am wondering what we should do in this context where For For
We might want to add some warnings during |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, but I am not sure we want this. It could result in a silent failure.
It think we should address the issue in another way. See my other comment.
@Cadene agreed on the warnings. I'm not totally sure on your proposed handling strategy though, unless you can confirm you've seen it done that way in other places. I'd rather stick to a more conventional method like adding 1e-8 to the denominator. It also does the job but it may cause less confusion to others trying to understand our code or port it into their own projects. Is there some reason your proposed method makes more sense? Edit: Also I noticed that prior to this pr we have |
@alexander-soare Let's merge this PR. In a future PR we need to add a warning if one or more dimensions are detected constant at the end of compute_stats. And we should add the same warning at the start of training if these stats are used. I will take care of it. |
Co-authored-by: rj <[email protected]> Co-authored-by: Remi <[email protected]>
Co-authored-by: rj <[email protected]> Co-authored-by: Remi <[email protected]>
What this does
Fixes #211. Normalize class could have a divide by 0 problem, e.g. when some of the states or actions have a fixed value.
How it was tested
Tested after extending push T / Diffusion policy to a real robot and fixing the non-XY states / actions.
This change is