DLR-RM / DLR-RM/stable-baselines3

Wrong types for policy parameters in Documentation

Open
#1,815 2 comments 0 reactions 0 assignees View on GitHub
documentation
Dominant language
Python
Stars
13.8k
Forks
2.2k
Avg merge
1h 35m
Merged PRs (30d)
2

Description

### 📚 Documentation

The documentation for all RL algorithms claims that the parameter policy has the type SACPolicy or ActorCriticPolicy or TD3Policy and so on: [https://stable-baselines3.readthedocs.io/en/master/modules/td3.html#parameters](url)
Example:
policy (TD3Policy) – The policy model to use (MlpPolicy, CnnPolicy, …)

This is not true, it expects either a string from the policy_aliases dict or a policy class. This is rather confusing and I just spend quite a bit figuring out why I could not pass a policy object.
In the docstrings and source code the type is correct.

I think the problem may be, that the type hints for the class variables overwrite the type hints for the parameters when the documentation is generated.

Should i just make a pull request with where I change the type hints for class variables?

### Checklist

- [X] I have checked that there is no similar [issue](https://github.com/DLR-RM/stable-baselines3/issues) in the repo
- [X] I have read the [documentation](https://stable-baselines3.readthedocs.io/en/master/)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.