Skip to content

Commit 2b78d92

Browse files
Updates minor RSL-RL configclass docstring (#4909)
Just a few docstring changes for consistency. Low priority and low risk. ## Type of change - Documentation update ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings
1 parent 87608f0 commit 2b78d92

4 files changed

Lines changed: 55 additions & 53 deletions

File tree

source/isaaclab_rl/isaaclab_rl/rsl_rl/distillation_cfg.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class RslRlDistillationAlgorithmCfg:
2222
"""Configuration for the distillation algorithm."""
2323

2424
class_name: str = "Distillation"
25-
"""The algorithm class name. Default is Distillation."""
25+
"""The algorithm class name. Defaults to Distillation."""
2626

2727
num_learning_epochs: int = MISSING
2828
"""The number of updates performed with each sample."""
@@ -34,13 +34,13 @@ class RslRlDistillationAlgorithmCfg:
3434
"""The number of environment steps the gradient flows back."""
3535

3636
max_grad_norm: None | float = None
37-
"""The maximum norm the gradient is clipped to."""
37+
"""The maximum norm the gradient is clipped to. Defaults to None."""
3838

3939
optimizer: Literal["adam", "adamw", "sgd", "rmsprop"] = "adam"
40-
"""The optimizer to use for the student policy."""
40+
"""The optimizer to use for the student policy. Defaults to adam."""
4141

4242
loss_type: Literal["mse", "huber"] = "mse"
43-
"""The loss type to use for the student policy."""
43+
"""The loss type to use for the student policy. Defaults to mse."""
4444

4545

4646
#########################
@@ -53,7 +53,7 @@ class RslRlDistillationRunnerCfg(RslRlBaseRunnerCfg):
5353
"""Configuration of the runner for distillation algorithms."""
5454

5555
class_name: str = "DistillationRunner"
56-
"""The runner class name. Default is DistillationRunner."""
56+
"""The runner class name. Defaults to DistillationRunner."""
5757

5858
student: RslRlMLPModelCfg = MISSING
5959
"""The student configuration."""
@@ -85,13 +85,13 @@ class RslRlDistillationStudentTeacherCfg:
8585
"""
8686

8787
class_name: str = "StudentTeacher"
88-
"""The policy class name. Default is StudentTeacher."""
88+
"""The policy class name. Defaults to StudentTeacher."""
8989

9090
init_noise_std: float = MISSING
9191
"""The initial noise standard deviation for the student policy."""
9292

9393
noise_std_type: Literal["scalar", "log"] = "scalar"
94-
"""The type of noise standard deviation for the policy. Default is scalar."""
94+
"""The type of noise standard deviation for the policy. Defaults to scalar."""
9595

9696
student_obs_normalization: bool = MISSING
9797
"""Whether to normalize the observation for the student network."""
@@ -117,7 +117,7 @@ class RslRlDistillationStudentTeacherRecurrentCfg(RslRlDistillationStudentTeache
117117
"""
118118

119119
class_name: str = "StudentTeacherRecurrent"
120-
"""The policy class name. Default is StudentTeacherRecurrent."""
120+
"""The policy class name. Defaults to StudentTeacherRecurrent."""
121121

122122
rnn_type: str = MISSING
123123
"""The type of the RNN network. Either "lstm" or "gru"."""

source/isaaclab_rl/isaaclab_rl/rsl_rl/rl_cfg.py

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class RslRlMLPModelCfg:
2323
"""Configuration for the MLP model."""
2424

2525
class_name: str = "MLPModel"
26-
"""The model class name. Default is MLPModel."""
26+
"""The model class name. Defaults to MLPModel."""
2727

2828
hidden_dims: list[int] = MISSING
2929
"""The hidden dimensions of the MLP network."""
@@ -32,10 +32,10 @@ class RslRlMLPModelCfg:
3232
"""The activation function for the MLP network."""
3333

3434
obs_normalization: bool = False
35-
"""Whether to normalize the observation for the model. Default is False."""
35+
"""Whether to normalize the observation for the model. Defaults to False."""
3636

3737
distribution_cfg: DistributionCfg | None = None
38-
"""The configuration for the output distribution. Default is None, in which case no distribution is used."""
38+
"""The configuration for the output distribution. Defaults to None, in which case no distribution is used."""
3939

4040
@configclass
4141
class DistributionCfg:
@@ -79,14 +79,14 @@ class HeteroscedasticGaussianDistributionCfg(GaussianDistributionCfg):
7979
"""
8080

8181
noise_std_type: Literal["scalar", "log"] = "scalar"
82-
"""The type of noise standard deviation for the model. Default is scalar.
82+
"""The type of noise standard deviation for the model. Defaults to scalar.
8383
8484
For rsl-rl >= 5.0.0, this configuration is is deprecated. Please use `distribution_cfg` instead and use the
8585
`std_type` field of the distribution configuration to specify the type of noise standard deviation.
8686
"""
8787

8888
state_dependent_std: bool = False
89-
"""Whether to use state-dependent standard deviation for the policy. Default is False.
89+
"""Whether to use state-dependent standard deviation for the policy. Defaults to False.
9090
9191
For rsl-rl >= 5.0.0, this configuration is is deprecated. Please use `distribution_cfg` instead and use
9292
the `HeteroscedasticGaussianDistributionCfg` if state-dependent standard deviation is desired.
@@ -98,7 +98,7 @@ class RslRlRNNModelCfg(RslRlMLPModelCfg):
9898
"""Configuration for RNN model."""
9999

100100
class_name: str = "RNNModel"
101-
"""The model class name. Default is RNNModel."""
101+
"""The model class name. Defaults to RNNModel."""
102102

103103
rnn_type: str = MISSING
104104
"""The type of RNN to use. Either "lstm" or "gru"."""
@@ -115,7 +115,7 @@ class RslRlCNNModelCfg(RslRlMLPModelCfg):
115115
"""Configuration for CNN model."""
116116

117117
class_name: str = "CNNModel"
118-
"""The model class name. Default is CNNModel."""
118+
"""The model class name. Defaults to CNNModel."""
119119

120120
@configclass
121121
class CNNCfg:
@@ -126,28 +126,28 @@ class CNNCfg:
126126
"""The kernel size for the CNN."""
127127

128128
stride: int | tuple[int] | list[int] = 1
129-
"""The stride for the CNN."""
129+
"""The stride for the CNN. Defaults to 1."""
130130

131131
dilation: int | tuple[int] | list[int] = 1
132-
"""The dilation for the CNN."""
132+
"""The dilation for the CNN. Defaults to 1."""
133133

134134
padding: Literal["none", "zeros", "reflect", "replicate", "circular"] = "none"
135-
"""The padding for the CNN."""
135+
"""The padding for the CNN. Defaults to none."""
136136

137137
norm: Literal["none", "batch", "layer"] | tuple[str] | list[str] = "none"
138-
"""The normalization for the CNN."""
138+
"""The normalization for the CNN. Defaults to none."""
139139

140140
activation: str = MISSING
141141
"""The activation function for the CNN."""
142142

143143
max_pool: bool | tuple[bool] | list[bool] = False
144-
"""Whether to use max pooling for the CNN."""
144+
"""Whether to use max pooling for the CNN. Defaults to False."""
145145

146146
global_pool: Literal["none", "max", "avg"] = "none"
147-
"""The global pooling for the CNN."""
147+
"""The global pooling for the CNN. Defaults to none."""
148148

149149
flatten: bool = True
150-
"""Whether to flatten the output of the CNN."""
150+
"""Whether to flatten the output of the CNN. Defaults to True."""
151151

152152
cnn_cfg: CNNCfg = MISSING
153153
"""The configuration for the CNN(s)."""
@@ -163,7 +163,7 @@ class RslRlPpoAlgorithmCfg:
163163
"""Configuration for the PPO algorithm."""
164164

165165
class_name: str = "PPO"
166-
"""The algorithm class name. Default is PPO."""
166+
"""The algorithm class name. Defaults to PPO."""
167167

168168
num_learning_epochs: int = MISSING
169169
"""The number of learning epochs per update."""
@@ -193,7 +193,7 @@ class RslRlPpoAlgorithmCfg:
193193
"""The maximum gradient norm."""
194194

195195
optimizer: Literal["adam", "adamw", "sgd", "rmsprop"] = "adam"
196-
"""The optimizer to use."""
196+
"""The optimizer to use. Defaults to adam."""
197197

198198
value_loss_coef: float = MISSING
199199
"""The coefficient for the value loss."""
@@ -205,7 +205,7 @@ class RslRlPpoAlgorithmCfg:
205205
"""The clipping parameter for the policy."""
206206

207207
normalize_advantage_per_mini_batch: bool = False
208-
"""Whether to normalize the advantage per mini-batch. Default is False.
208+
"""Whether to normalize the advantage per mini-batch. Defaults to False.
209209
210210
If True, the advantage is normalized over the mini-batches only.
211211
Otherwise, the advantage is normalized over the entire collected trajectories.
@@ -215,10 +215,10 @@ class RslRlPpoAlgorithmCfg:
215215
"""Whether to share the CNN networks between actor and critic, in case CNNModels are used. Defaults to False."""
216216

217217
rnd_cfg: RslRlRndCfg | None = None
218-
"""The RND configuration. Default is None, in which case RND is not used."""
218+
"""The RND configuration. Defaults to None, in which case RND is not used."""
219219

220220
symmetry_cfg: RslRlSymmetryCfg | None = None
221-
"""The symmetry configuration. Default is None, in which case symmetry is not used."""
221+
"""The symmetry configuration. Defaults to None, in which case symmetry is not used."""
222222

223223

224224
#########################
@@ -231,10 +231,10 @@ class RslRlBaseRunnerCfg:
231231
"""Base configuration of the runner."""
232232

233233
seed: int = 42
234-
"""The seed for the experiment. Default is 42."""
234+
"""The seed for the experiment. Defaults to 42."""
235235

236236
device: str = "cuda:0"
237-
"""The device for the rl-agent. Default is cuda:0."""
237+
"""The device for the rl-agent. Defaults to cuda:0."""
238238

239239
num_steps_per_env: int = MISSING
240240
"""The number of steps per environment per update."""
@@ -288,36 +288,36 @@ class RslRlBaseRunnerCfg:
288288
"""The experiment name."""
289289

290290
run_name: str = ""
291-
"""The run name. Default is empty string.
291+
"""The run name. Defaults to empty string.
292292
293293
The name of the run directory is typically the time-stamp at execution. If the run name is not empty,
294294
then it is appended to the run directory's name, i.e. the logging directory's name will become
295295
``{time-stamp}_{run_name}``.
296296
"""
297297

298298
logger: Literal["tensorboard", "neptune", "wandb"] = "tensorboard"
299-
"""The logger to use. Default is tensorboard."""
299+
"""The logger to use. Defaults to tensorboard."""
300300

301301
neptune_project: str = "isaaclab"
302-
"""The neptune project name. Default is "isaaclab"."""
302+
"""The neptune project name. Defaults to "isaaclab"."""
303303

304304
wandb_project: str = "isaaclab"
305-
"""The wandb project name. Default is "isaaclab"."""
305+
"""The wandb project name. Defaults to "isaaclab"."""
306306

307307
resume: bool = False
308-
"""Whether to resume a previous training. Default is False.
308+
"""Whether to resume a previous training. Defaults to False.
309309
310310
This flag will be ignored for distillation.
311311
"""
312312

313313
load_run: str = ".*"
314-
"""The run directory to load. Default is ".*" (all).
314+
"""The run directory to load. Defaults to ".*" (all).
315315
316316
If regex expression, the latest (alphabetical order) matching run will be loaded.
317317
"""
318318

319319
load_checkpoint: str = "model_.*.pt"
320-
"""The checkpoint file to load. Default is ``"model_.*.pt"`` (all).
320+
"""The checkpoint file to load. Defaults to ``"model_.*.pt"`` (all).
321321
322322
If regex expression, the latest (alphabetical order) matching file will be loaded.
323323
"""
@@ -328,7 +328,7 @@ class RslRlOnPolicyRunnerCfg(RslRlBaseRunnerCfg):
328328
"""Configuration of the runner for on-policy algorithms."""
329329

330330
class_name: str = "OnPolicyRunner"
331-
"""The runner class name. Default is OnPolicyRunner."""
331+
"""The runner class name. Defaults to OnPolicyRunner."""
332332

333333
actor: RslRlMLPModelCfg = MISSING
334334
"""The actor configuration."""
@@ -360,16 +360,16 @@ class RslRlPpoActorCriticCfg:
360360
"""
361361

362362
class_name: str = "ActorCritic"
363-
"""The policy class name. Default is ActorCritic."""
363+
"""The policy class name. Defaults to ActorCritic."""
364364

365365
init_noise_std: float = MISSING
366366
"""The initial noise standard deviation for the policy."""
367367

368368
noise_std_type: Literal["scalar", "log"] = "scalar"
369-
"""The type of noise standard deviation for the policy. Default is scalar."""
369+
"""The type of noise standard deviation for the policy. Defaults to scalar."""
370370

371371
state_dependent_std: bool = False
372-
"""Whether to use state-dependent standard deviation for the policy. Default is False."""
372+
"""Whether to use state-dependent standard deviation for the policy. Defaults to False."""
373373

374374
actor_obs_normalization: bool = MISSING
375375
"""Whether to normalize the observation for the actor network."""
@@ -395,7 +395,7 @@ class RslRlPpoActorCriticRecurrentCfg(RslRlPpoActorCriticCfg):
395395
"""
396396

397397
class_name: str = "ActorCriticRecurrent"
398-
"""The policy class name. Default is ActorCriticRecurrent."""
398+
"""The policy class name. Defaults to ActorCriticRecurrent."""
399399

400400
rnn_type: str = MISSING
401401
"""The type of RNN to use. Either "lstm" or "gru"."""

source/isaaclab_rl/isaaclab_rl/rsl_rl/rnd_cfg.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class WeightScheduleCfg:
2020
"""Configuration for the weight schedule."""
2121

2222
mode: str = "constant"
23-
"""The type of weight schedule. Default is "constant"."""
23+
"""The type of weight schedule. Defaults to "constant"."""
2424

2525
@configclass
2626
class LinearWeightScheduleCfg(WeightScheduleCfg):
@@ -31,6 +31,7 @@ class LinearWeightScheduleCfg(WeightScheduleCfg):
3131
"""
3232

3333
mode: str = "linear"
34+
"""The type of weight schedule. Defaults to "linear"."""
3435

3536
final_value: float = MISSING
3637
"""The final value of the weight parameter."""
@@ -55,6 +56,7 @@ class StepWeightScheduleCfg(WeightScheduleCfg):
5556
"""
5657

5758
mode: str = "step"
59+
"""The type of weight schedule. Defaults to "step"."""
5860

5961
final_step: int = MISSING
6062
"""The final step of the weight schedule.
@@ -66,34 +68,34 @@ class StepWeightScheduleCfg(WeightScheduleCfg):
6668
"""The final value of the weight parameter."""
6769

6870
weight: float = 0.0
69-
"""The weight for the RND reward (also known as intrinsic reward). Default is 0.0.
71+
"""The weight for the RND reward (also known as intrinsic reward). Defaults to 0.0.
7072
7173
Similar to other reward terms, the RND reward is scaled by this weight.
7274
"""
7375

7476
weight_schedule: WeightScheduleCfg | None = None
75-
"""The weight schedule for the RND reward. Default is None, which means the weight is constant."""
77+
"""The weight schedule for the RND reward. Defaults to None, which means the weight is constant."""
7678

7779
reward_normalization: bool = False
78-
"""Whether to normalize the RND reward. Default is False."""
80+
"""Whether to normalize the RND reward. Defaults to False."""
7981

8082
state_normalization: bool = False
81-
"""Whether to normalize the RND state. Default is False."""
83+
"""Whether to normalize the RND state. Defaults to False."""
8284

8385
learning_rate: float = 1e-3
84-
"""The learning rate for the RND module. Default is 1e-3."""
86+
"""The learning rate for the RND module. Defaults to 1e-3."""
8587

8688
num_outputs: int = 1
87-
"""The number of outputs for the RND module. Default is 1."""
89+
"""The number of outputs for the RND module. Defaults to 1."""
8890

8991
predictor_hidden_dims: list[int] = [-1]
90-
"""The hidden dimensions for the RND predictor network. Default is [-1].
92+
"""The hidden dimensions for the RND predictor network. Defaults to [-1].
9193
9294
If the list contains -1, then the hidden dimensions are the same as the input dimensions.
9395
"""
9496

9597
target_hidden_dims: list[int] = [-1]
96-
"""The hidden dimensions for the RND target network. Default is [-1].
98+
"""The hidden dimensions for the RND target network. Defaults to [-1].
9799
98100
If the list contains -1, then the hidden dimensions are the same as the input dimensions.
99101
"""

source/isaaclab_rl/isaaclab_rl/rsl_rl/symmetry_cfg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ class RslRlSymmetryCfg:
2626
"""
2727

2828
use_data_augmentation: bool = False
29-
"""Whether to use symmetry-based data augmentation. Default is False."""
29+
"""Whether to use symmetry-based data augmentation. Defaults to False."""
3030

3131
use_mirror_loss: bool = False
32-
"""Whether to use the symmetry-augmentation loss. Default is False."""
32+
"""Whether to use the symmetry-augmentation loss. Defaults to False."""
3333

3434
data_augmentation_func: callable = MISSING
3535
"""The symmetry data augmentation function.
@@ -48,4 +48,4 @@ class RslRlSymmetryCfg:
4848
"""
4949

5050
mirror_loss_coeff: float = 0.0
51-
"""The weight for the symmetry-mirror loss. Default is 0.0."""
51+
"""The weight for the symmetry-mirror loss. Defaults to 0.0."""

0 commit comments

Comments
 (0)