Skip to content

Conversation

jstrube
Copy link

@jstrube jstrube commented Apr 25, 2020

I've been trying to get the Gym working for the control problems in the model zoo.
These fixes to Gym (together with fixes in the model zoo) allowed me to get this working with the latest version of Flux

return env._env.state
end
end
return _get_obs(env._env)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to get rid of the catch?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall exactly what the error message was that caused me to remove it. Maybe Zygote can't differentiate through it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes we don't support try blocks in zygote yet.

But this would seem to break Gym's assumptions about what to do in case of an error here. I'm happy to have a wrapper method that would dispatch accordingly to get rid of try block

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have a _get_obs which by default returns env._env.state

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have that dispatched correctly and have this merged then?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand enough about this to implement "correct dispatch", but I think you can edit the pull request.


trainable(env::EnvWrapper) = env.train
game_over(env::EnvWrapper) = env.done
game_over(env::EnvWrapper) = env.done
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting error

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, funny. I didn't realize I had touched that line. I had used the web editor. If this is a problem, I think you have permission to fix this inline.

@DhairyaLGandhi
Copy link
Member

cc @tejank10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants