Stable-Baselines-Team / stable-baselines3-contrib

Contrib package for Stable-Baselines3 - Experimental reinforcement learning (RL) code
https://sb3-contrib.readthedocs.io
MIT License
504 stars 175 forks source link

Maskable PPO: Specify masking actions #141

Closed gowthamnatarajan closed 1 year ago

gowthamnatarajan commented 1 year ago

I looked at the documentation on using masking actions but did not understand. My custom environment has 6 actions. But I would like to mask / disable certain actions based on the current state.

The example I see just says: env = InvalidActionEnvDiscrete(dim=80, n_invalid_actions=60)

But how do I exactly check the current state and specify invalid actions for that state?

araffin commented 1 year ago

duplicate of https://github.com/Stable-Baselines-Team/stable-baselines3-contrib/issues/72 (and #102 )