-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Don't clamp timescale to 100 outside of editor #4867
Conversation
#else | ||
const cloat maxTimeScale = float.PositiveInfinity; | ||
#endif | ||
timeScale = Mathf.Clamp(timeScale, 1, maxTimeScale); |
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.
Could there be cases where someone wants to train at timescales between (0,1]?
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.
and do we want to support that?
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.
I can't imagine for training, but there could hypothetically be an inference use-case where someone might want it to go slower to better inspect the agent behavior.
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.
This block of code only affects timescale information coming from python (generally mlagents-learn
commandline, but could be the yaml config or low-level API too), so inference isn't affected by this.
So far there haven't been any requests for timescale < 1, but we can change the lower bound to, say, 0.01.
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.
Looks good to me. I wasn't aware of the 100 limit in the editor, but I imagine it was kept in place to prevent locking up the editor when in play mode.
I wonder if we have an environment which would benefit from the higher timescale. It would likely have to have neither physics nor rendering, so perhaps Match3? |
AFAIK we don't override the defaults for training in any scene. I'm not sure Match3 would benefit since it doesn't have any physics or animation; moves are requested on every step. |
Proposed change(s)
Remove the upper limit of 100 for the timescale when using the player. We can't remove the limit entirely, since the Editor still requires it.
Note that having a lower bound of 1 is still worthwhile, so we clamp to [1, Infinity] in the player for simplicity.
Also made a SideChannel tests directory, since I have another one to add in another PR.
Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
https://jira.unity3d.com/browse/MLA-748
First noted in #3596
Editor code
Types of change(s)
Checklist