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

start value of Discrete spaces #2054

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

JoshuaBluem
Copy link

@JoshuaBluem JoshuaBluem commented Dec 6, 2024

Description

This fixes the missing applying of start value of Discrete Space

The start value of "spaces.Discrete(3, start=-1)" has no effect and does not shift the space to given start value, even tough there are examples in the Discrete class like: observation_space = Discrete(3, start=-1, seed=42) # {-1, 0, 1}
All Discrete Spaces start currently at zero.

Motivation and Context

This is a bug-fix relating to #2052, #913, #1295, #1378

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

The start value of spaces.Discrete is added to the actions to properly shift space
Reason for this position is, its the same position, the final scaling of spaces.Box happen. spaces.Discrete was never handled

  • Bug fix (non-breaking change which fixes an issue)
  • [No] New feature (non-breaking change which adds functionality)
  • [No] Breaking change (fix or feature that would cause existing functionality to change)
  • [No] Documentation (update in the documentation)

Checklist

  • I've read the CONTRIBUTION guide (required)
  • I have updated the changelog accordingly (required).
  • [No] My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • [No] I have updated the documentation accordingly.
  • [No] I have opened an associated PR on the SB3-Contrib repository (if necessary)
  • [No] I have opened an associated PR on the RL-Zoo3 repository (if necessary)
  • I have reformatted the code using make format (required)
  • I have checked the codestyle using make check-codestyle and make lint (required)
  • I have ensured make pytest and make type both pass. (required)
  • I have checked that the documentation builds using make doc (required)

Note: You can run most of the checks using make commit-checks.

Note: we are using a maximum length of 127 characters per line

JoshuaBluem and others added 2 commits December 6, 2024 04:09
The start value of Discrete Action-Space had no effect previously and it is now supported
Added tests to the pylint checks to confirm the correct action bounds of predict and step method
Supports start value of MultiDiscrete and now.
Also updated changelog, +1 test_case, removed env_checker warning for usage of startvalue
Reduced long message line
@JoshuaBluem JoshuaBluem marked this pull request as ready for review December 6, 2024 06:43
reformatting
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.

1 participant