-
Notifications
You must be signed in to change notification settings - Fork 354
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
Deal with more Gym cases #1327
base: main
Are you sure you want to change the base?
Deal with more Gym cases #1327
Conversation
nevergrad/functions/gym/multigym.py
Outdated
if type(a) == tuple: | ||
try: | ||
a = tuple(int(_a + 0.5) for _a in a) | ||
except: # oh my FSM! A tuple of nd-array probably. | ||
a = tuple(np.asarray(_a+.5, dtype=int) for _a in a) |
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.
does it have to be tuples ? np.round(a) would be much simpler
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.
It depends on the gym problem, not on nevergrad.
The point is to deal with (at least some) nested structures which are not ndarray.
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.
usually I would expect it's simpler to convert everything to array, and then update the type if need be
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.
There are complicated types in Gym actually. You can have a dict of tuple of ndarray or stuff like that.
Types of changes
Motivation and Context / Related issue
How Has This Been Tested (if it applies)
Checklist