Skip to content

Commit b63c5d6

Browse files
committed
Doc fix following copilot suggestions
1 parent 497aecb commit b63c5d6

7 files changed

Lines changed: 31 additions & 31 deletions

File tree

docs/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
# The suffix(es) of source filenames.
8787
# You can specify multiple suffix as a list of string:
8888
#
89-
# source_suffix = ['.rst', '.md']
90-
source_suffix = ".rst"
89+
source_suffix = [".rst", ".md"]
90+
# source_suffix = ".rst"
9191

9292
# The master toctree document.
9393
master_doc = "index"
@@ -207,9 +207,9 @@ def setup(app):
207207
# "amsmath",
208208
"attrs_inline",
209209
"colon_fence",
210-
# "deflist",
210+
"deflist",
211211
"dollarmath",
212-
# "fieldlist",
212+
"fieldlist",
213213
# "html_admonition",
214214
"html_image",
215215
# "linkify",

docs/guide/algos.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ along with some useful characteristics: support for discrete/continuous actions,
1212
| DQN || ✔️ ||| ✔️ |
1313
| HER | ✔️ | ✔️ ||| ✔️ |
1414
| PPO | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
15-
| QR-DQN [^f1] || ✔️ ||| ✔️ |
15+
| QR-DQN [^f1] || ️✔️ ||| ✔️ |
1616
| RecurrentPPO [^f1] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
1717
| SAC | ✔️ |||| ✔️ |
1818
| TD3 | ✔️ |||| ✔️ |

docs/guide/custom_env.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ SB3 doesn't support `Discrete` and `MultiDiscrete` spaces with `start!=0`. Howev
2727
import gymnasium as gym
2828

2929
class ShiftWrapper(gym.Wrapper):
30-
"""Allow to use Discrete() action spaces with start!=0"""
31-
def __init__(self, env: gym.Env) -> None:
32-
super().__init__(env)
33-
assert isinstance(env.action_space, gym.spaces.Discrete)
34-
self.action_space = gym.spaces.Discrete(env.action_space.n, start=0)
35-
36-
def step(self, action: int):
37-
return self.env.step(action + self.env.action_space.start)
30+
"""Allow to use Discrete() action spaces with start!=0"""
31+
def __init__(self, env: gym.Env) -> None:
32+
super().__init__(env)
33+
assert isinstance(env.action_space, gym.spaces.Discrete)
34+
self.action_space = gym.spaces.Discrete(env.action_space.n, start=0)
35+
36+
def step(self, action: int):
37+
return self.env.step(action + self.env.action_space.start)
3838
```
3939
:::
4040

@@ -46,15 +46,15 @@ import numpy as np
4646
import gymnasium as gym
4747

4848
class ReshapeWrapper(gym.Wrapper):
49-
"""Allow to use MultiDiscrete() action spaces with len(nvec.shape) > 1:"""
50-
def __init__(self, env: gym.Env) -> None:
51-
super().__init__(env)
52-
assert isinstance(env.action_space, gym.spaces.MultiDiscrete)
53-
self.original_shape = env.action_space.nvec.shape
54-
self.action_space = gym.spaces.MultiDiscrete(env.action_space.nvec.flatten())
55-
56-
def step(self, action: np.ndarray):
57-
return self.env.step(action.reshape(self.original_shape))
49+
"""Allow to use MultiDiscrete() action spaces with len(nvec.shape) > 1:"""
50+
def __init__(self, env: gym.Env) -> None:
51+
super().__init__(env)
52+
assert isinstance(env.action_space, gym.spaces.MultiDiscrete)
53+
self.original_shape = env.action_space.nvec.shape
54+
self.action_space = gym.spaces.MultiDiscrete(env.action_space.nvec.flatten())
55+
56+
def step(self, action: np.ndarray):
57+
return self.env.step(action.reshape(self.original_shape))
5858
```
5959
:::
6060

docs/guide/imitation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
The [imitation](https://github.com/HumanCompatibleAI/imitation) library implements
66
imitation learning algorithms on top of Stable-Baselines3, including:
77

8-
> - Behavioral Cloning
9-
> - [DAgger](https://arxiv.org/abs/1011.0686) with synthetic examples
10-
> - [Adversarial Inverse Reinforcement Learning](https://arxiv.org/abs/1710.11248) (AIRL)
11-
> - [Generative Adversarial Imitation Learning](https://arxiv.org/abs/1606.03476) (GAIL)
12-
> - [Deep RL from Human Preferences](https://arxiv.org/abs/1706.03741) (DRLHP)
8+
- Behavioral Cloning
9+
- [DAgger](https://arxiv.org/abs/1011.0686) with synthetic examples
10+
- [Adversarial Inverse Reinforcement Learning](https://arxiv.org/abs/1710.11248) (AIRL)
11+
- [Generative Adversarial Imitation Learning](https://arxiv.org/abs/1606.03476) (GAIL)
12+
- [Deep RL from Human Preferences](https://arxiv.org/abs/1706.03741) (DRLHP)
1313

1414
You can install imitation with `pip install imitation`. The [imitation
1515
documentation](https://imitation.readthedocs.io/en/latest/) has more details

docs/guide/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ and [issue #90](https://github.com/DLR-RM/stable-baselines3/issues/90).
3636
- SB3 requires python 3.7+ (instead of python 3.5+ for SB2)
3737
- Dropped MPI support
3838
- Dropped layer normalized policies (`MlpLnLstmPolicy`, `CnnLnLstmPolicy`)
39-
- LSTM policies (`` `MlpLstmPolicy` ``, `` `CnnLstmPolicy` ``) are not supported for the time being
39+
- LSTM policies (`MlpLstmPolicy`, `CnnLstmPolicy`) are not supported for the time being
4040
(see [PR #53](https://github.com/Stable-Baselines-Team/stable-baselines3-contrib/pull/53) for a recurrent PPO implementation)
4141
- Dropped parameter noise for DDPG and DQN
4242
- PPO is now closer to the original implementation (no clipping of the value function by default), cf PPO section below

docs/guide/plotting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ if len(x) >= 50: # Only smooth if we have enough data
163163
x_smooth, y_smooth = window_func(x, y, 50, np.mean)
164164
plt.plot(x_smooth, y_smooth, linewidth=2)
165165
plt.xlabel("Timesteps")
166-
plt.ylabel("Average Episode Reward (50-episode window)"")
166+
plt.ylabel("Average Episode Reward (50-episode window)")
167167
plt.title("Smoothed Episode Rewards")
168168

169169
plt.tight_layout()

docs/guide/vec_envs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ vec_env = make_vec_env(MyMultiTaskEnv)
138138
# Note: you should use vec_env.env_method("get_wrapper_attr", "mu") in Gymnasium v1.0
139139
print(vec_env.env_method("get_wrapper_attr", "mu"))
140140
# Change `mu` attribute via the setter
141-
vec_env.env_method("set_mu", "mu", 0.1)
141+
vec_env.env_method("set_mu", 0.1)
142142
# If the variable exists, you can also use `set_wrapper_attr` to set it
143143
assert vec_env.has_attr("mu")
144144
vec_env.env_method("set_wrapper_attr", "mu", 0.1)
@@ -157,7 +157,7 @@ class ChangeMuCallback(BaseCallback):
157157
The environment is implemented so that the impact of changing
158158
the value of mu mid-episode is visible only after the episode is over
159159
and the reset method has been called.
160-
""""
160+
"""
161161
def __init__(self):
162162
super().__init__()
163163
# An iterator that contains the different of the friction coefficient

0 commit comments

Comments
 (0)