-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Add mild domain randomization to Car Racing Env #2749
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
|
Could you add a test for Edit: |
|
Yea I couldn't find any tests for CarRacing, and I agree with you that there should be. I'll get to implementing one then. Though it remains an interesting question what should be tested. In the lunar lander case, it could be tested because there was already a heuristic algorithm that could solve the environment. There doesn't seem to be one for car racing. |
RedTachyon
left a comment
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.
Overall looks good, just left one nitpicky comment for code quality
Actually, one thought. Would it make sense to name this something else than hardcore? I know there are some envs that already follow this naming pattern, but it's extraordinarily undescriptive.
Also - we might want to register an extra env to make it easier to create this version, something like "CarRacingHardcore" or whatever Hardcore might get renamed to.
gym/envs/box2d/car_racing.py
Outdated
| self.grass_color[idx] += 20 | ||
| else: | ||
| # default colours | ||
| self.norm_road_color = np.array([0.4, 0.4, 0.4]) |
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.
Do we have to store the colors with two different representations? (one is 0-1, the other is 0-255)
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.
Gotcha, fixed it
gym/envs/box2d/car_racing.py
Outdated
| ### Version History | ||
| - v0: Current version | ||
| - v1: Current version (0.23.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.
I guess v0 can be labelled as the original version; v1 will come live with 0.24.0 at the earliest, so probably better to put that (seeing as 0.23.1 is already out)
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.
Gotcha, fixed it
|
@RedTachyon I've changed |
Description
This adds a mild domain randomization trait to the Car Racing Env.
Simply pass
domain_randomize=True, and the road and background colours will be randomized.Type of change
Before
After
Checklist:
pre-commitchecks withpre-commit run --all-files(seeCONTRIBUTING.mdinstructions to set it up)