-
Notifications
You must be signed in to change notification settings - Fork 157
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
Gymnasium support #192
Draft
prabhatnagarajan
wants to merge
30
commits into
pfnet:master
Choose a base branch
from
prabhatnagarajan:gymnasium_support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+443
−665
Draft
Gymnasium support #192
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
a413077
Adds gymnasium to the setup
prabhatnagarajan 35a420c
gym -> gymnasium
prabhatnagarajan e1d7ead
modifies calls to env step to use truncations
prabhatnagarajan c804fe3
some Atari changes
prabhatnagarajan 5daca4c
Makes more env modifications
prabhatnagarajan 85fe46f
Fixes some observations, and uses new Gym AtariEnv properly
prabhatnagarajan c7d62f7
makes some evaluator updates
prabhatnagarajan b51ae32
Gets evaluations working by modifying RandomizeAction class
prabhatnagarajan ffdc311
fixes setup
prabhatnagarajan 07c464b
Adds a generic GymWrapper
prabhatnagarajan 675c978
Shifts Pendulum version in example to v1 since v0 is deprecated
prabhatnagarajan 85c38e1
Adds Q value computation to DDQN (and by extension DDQN)
prabhatnagarajan 02048ae
removes filelock from setup
prabhatnagarajan 98a4efc
removes all required items
prabhatnagarajan 4818545
fixes setup
prabhatnagarajan e3c867c
merges with master
prabhatnagarajan 3f98ef7
does gymnasium all to gymnasium atari
prabhatnagarajan b145609
Fixes multiprocessvector_env step
prabhatnagarajan 0c770b5
Multiprocess fixes
brett-daley e82663e
Merge pull request #6 from brett-daley/gymnasium_support
prabhatnagarajan 04c1dd5
OpenAI -> Farama Foundation
prabhatnagarajan c408b08
Makes modifications for gymnasium imports, etc.
prabhatnagarajan 03f203f
Removes continuing_time_limit now that gymnasium has truncation
prabhatnagarajan 5614323
Remove Monitor
prabhatnagarajan 4b0494e
Removes things from __init__
prabhatnagarajan e92cc63
Moves gym folder in examples to gymnasium
prabhatnagarajan 420dddb
Fixes some imports and some tests
prabhatnagarajan 74198b9
Fixes Randomize Action Wrapper
prabhatnagarajan 3237561
merges with main
prabhatnagarajan 6f0eac6
Merge branch 'master' into gymnasium_support
prabhatnagarajan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ build/ | |
dist/ | ||
.idea/ | ||
results/ | ||
examples/gym/results/ | ||
examples/gymnasium/results/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ main() { | |
# pytest does not run with attrs==19.2.0 (https://github.com/pytest-dev/pytest/issues/3280) # NOQA | ||
"${PYTHON}" -m pip install \ | ||
'pytest==4.1.1' 'attrs==19.1.0' 'pytest-xdist==1.26.1' \ | ||
'gym[atari,classic_control]==0.19.0' 'optuna' 'zipp==1.0.0' 'pybullet==2.8.1' 'jupyterlab==2.1.5' 'traitlets==5.1.1' 'pyglet==1.5.27' | ||
'gymnasium[atari,classic_control]==0.19.0' 'optuna' 'zipp==1.0.0' 'pybullet==2.8.1' 'jupyterlab==2.1.5' 'traitlets==5.1.1' | ||
|
||
git config --global user.email "[email protected]" | ||
git config --global user.name "Your Name" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Examples for OpenAI gymnasium environments | ||
|
||
- `train_categorical_dqn_gymnasium.py`: CategoricalDQN for discrete action action spaces | ||
- `train_dqn_gymnasium.py`: DQN for both discrete action and continuous action spaces | ||
- `train_reinforce_gymnasium.py`: REINFORCE for both discrete action and continuous action spaces (only for episodic envs) | ||
|
||
## How to run | ||
|
||
``` | ||
python train_categorical_dqn_gymnasium.py [options] | ||
python train_dqn_gymnasium.py [options] | ||
python train_reinforce_gymnasium.py [options] | ||
``` | ||
|
||
Specify `--help` or read code for options. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm not familiar with gymnasium much, but is it recommended to write
import gymnasium as gym
?Do you know any article about coding convention of gymnasium?
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'm not sure. The examples they give often write what you have, but I think it's just to sell the simplicity of their transition from gym to gymnasium. I also think the distinction can help for clarity, so people are reminded which API is being used.
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.
Hmm it does seem even internally in their code they use
gym
as you say.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.
Thanks. Anyway I agree with your opinion: