Understanding action space in stable baselines I was trying to write reinforcement learning agent using stable-baselines3 library. The agent(abservations) method should return action. I went through different models API (like PPO) and they do not really allow us to specify action space. Instead action space is specified in environment.
This notebook says:

The type of action to use (discrete/continuous) will be automatically deduced from the environment action space.

So, it seems that &quot;model&quot; deduce action space from environment.
Q1. But exactly how?
Q2. Also how my agent(observations) method should return action? By returning action returned by model.predict()?
I guess I got answer to Q1. Sharing my understanding below:

PPO extends OnPolicyAlgorithm
PPO calls super(..,env,..), that is OnPolicyAlgorithm(..,env,..)
OnPolicyAlgorithm extends BaseAlgorithm
OnPolicyAlgorithm calls super(..,env,..), that is BaseAlgorithm(..,env,..)
BaseAlgorithm seems to obtain action_space from env

Still I am unable to get answer Q2.