Skip to content
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

Update vector space utility functions for all spaces #223

Conversation

pseudo-rnd-thoughts
Copy link
Member

I am improving some of the wrappers and I found that we can use several of the built-in vector functions for generating empty arrays, stacking observations, etc

In this PR, I have copied the original space utility functions from vector which were in two files, spaces and numpy_utils into a single file, space_utils, the functions are batch_space, concatenate, iterate and create_empty_array

I have not changed the implementation of the functions other than adding new functions for the Sequence, Text, Graph spaces

For testing, I have not included expected outputs for each of the functions. This can be added, rather I have opted for functionality testing of the functions, in particular the interface between the four functions

@pseudo-rnd-thoughts pseudo-rnd-thoughts changed the base branch from main to new-vector-api December 27, 2022 15:03
@RedTachyon
Copy link
Member

I'm slightly confused by this, as I understand this is just refactoring of existing code, except it's put into the experimental directory, so it kinda looks like new code in the diff? Wouldn't it be better to just change it in the live version of the repo, and then it will get merged with the experimental stuff when that becomes stable?

Copy link
Member Author

@pseudo-rnd-thoughts pseudo-rnd-thoughts left a comment

Choose a reason for hiding this comment

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

With this implementation, the functions are in a single file where before the functions were in two functions (numpy_utils.py and spaces.py)

Im happy to add the changes to root vector

@pseudo-rnd-thoughts pseudo-rnd-thoughts changed the base branch from new-vector-api to main January 25, 2023 16:15
pseudo-rnd-thoughts

This comment was marked as outdated.

@pseudo-rnd-thoughts pseudo-rnd-thoughts changed the title Add (experimental) vector space utility functions Update vector space utility functions for all spaces Jan 31, 2023
# Conflicts:
#	gymnasium/experimental/vector/__init__.py
# Conflicts:
#	gymnasium/experimental/vector/utils/__init__.py
#	gymnasium/experimental/vector/utils/space_utils.py
#	tests/experimental/vector/__init__.py
#	tests/experimental/vector/utils/__init__.py
#	tests/experimental/vector/utils/test_space_utils.py
@vercel
Copy link

vercel bot commented Feb 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
gymnasium ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 22, 2023 at 2:14PM (UTC)

# Conflicts:
#	tests/spaces/utils.py
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.

2 participants