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

MultiDiscrete to discrete gym action space wrapper #664

Merged
merged 15 commits into from
Jun 12, 2022

Conversation

BFAnas
Copy link
Contributor

@BFAnas BFAnas commented Jun 9, 2022

  • I have marked all applicable categories:
    • exception-raising fix
    • algorithm implementation fix
    • documentation modification
    • new feature
  • I have reformatted the code using make format (required)
  • I have checked the code using make commit-checks (required)
  • If applicable, I have mentioned the relevant/related issue(s)
  • If applicable, I have listed every items in this Pull Request below

Has been tested to work with DQN and a custom MultiDiscrete gym env. #643 #311 #236

@nuance1979 nuance1979 changed the title MultiDiscrete to discrete gym action space wrapper #643 #311 #236 MultiDiscrete to discrete gym action space wrapper Jun 9, 2022
tianshou/env/gym_wrappers.py Outdated Show resolved Hide resolved
tianshou/env/gym_wrappers.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jun 11, 2022

Codecov Report

Merging #664 (7f0cf0e) into master (21b1580) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #664      +/-   ##
==========================================
+ Coverage   93.66%   93.69%   +0.02%     
==========================================
  Files          72       72              
  Lines        4786     4805      +19     
==========================================
+ Hits         4483     4502      +19     
  Misses        303      303              
Flag Coverage Δ
unittests 93.69% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
tianshou/env/__init__.py 75.00% <100.00%> (ø)
tianshou/env/gym_wrappers.py 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@nuance1979
Copy link
Collaborator

Can you please add a test in test/base/test_env.py? It should check the conversion works correctly for both a single action and a batch of actions. See examples in the same file.

Trinkle23897
Trinkle23897 previously approved these changes Jun 12, 2022
@Trinkle23897 Trinkle23897 merged commit aba2d01 into thu-ml:master Jun 12, 2022
BFAnas added a commit to BFAnas/tianshou that referenced this pull request May 5, 2024
Has been tested to work with DQN and a custom MultiDiscrete gym env.
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.

4 participants