-
Notifications
You must be signed in to change notification settings - Fork 185
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
please add observation and action spaces #241
Comments
Hi @bionicles, I'd be happy to integrate it into TextWorld. Can you make a PR to add it to https://github.com/microsoft/TextWorld/blob/master/textworld/gym/spaces/text_spaces.py ? Also, note the existing |
What space would be a reasonable default? It might be better to use an existing one if it's built for this (less code) (just curious because spaces help with random actions and normalization) |
Sorry for the delay in getting back to you, I just got back from paternity leave. What default are you referring to? If you are talking about TextworldGymEnv, I've set it to None to force the user to think of what makes sense in their case. The main reason being I wasn't sure how to pick good values for |
congrats on being a new dad! here's what i wound up doing so far: however, that's gonna pass raw strings to the agent, so the agent needs a string sensor to handle string observations another option which plays better with frameworks would be to convert the text into a numpy array of UTF-8 bytes (uint8) then cast to float32 and normalize... this could go in a wrapper, and the observation could then just be a float32 gym.spaces.Box
here's a utf-8 actuator ( also could go in a wrapper ) ... it stops writing at the first non-UTF8 byte
then the rescale function is this:
here's some tinkering with the string space
here's a wrapper to make various difficulty levels:
|
just for completeness, here is the rng class
|
Thanks for sharing your code. I like the style and it is very insightful. I never thought of changing the env.action_space at every step (i.e. choice-based setting) but that might not play well with some existing algorithms, e.g. in the OpenAI's baselines repo: PolicyWithValue where I'd be happy to integrate your |
@MarcCote @bionicles any updates on the above. It seems like there are a few warnings these days from Maybe it is now related to: |
This was not integrated in TextWorld yet. I'd be happy to review any PR though. |
Dependency on |
this is a key component of the gym API
here's a custom space for strings (license: MIT, author: Bion Howard)
The text was updated successfully, but these errors were encountered: