|
12 | 12 |
|
13 | 13 | @configclass |
14 | 14 | class TorchRlMlpModelCfg: |
15 | | - """Configuration of an MLP used by :class:`~isaaclab_rl.torchrl.TorchRlPpoRunner`.""" |
| 15 | + """MLP used for the actor and the critic of :class:`~isaaclab_rl.torchrl.TorchRlPpoRunner`.""" |
16 | 16 |
|
17 | 17 | hidden_dims: list[int] = MISSING |
18 | 18 | """Sizes of the hidden layers.""" |
19 | 19 |
|
20 | | - activation: str = "elu" |
21 | | - """Activation function, one of ``"elu"``, ``"relu"``, ``"tanh"``, ``"selu"``, ``"gelu"`` or ``"silu"``.""" |
| 20 | + activation: str = "ELU" |
| 21 | + """Name of a :mod:`torch.nn` activation class, e.g. ``"ELU"``, ``"ReLU"`` or ``"Tanh"``.""" |
22 | 22 |
|
23 | 23 |
|
24 | 24 | @configclass |
25 | 25 | class TorchRlPpoAlgorithmCfg: |
26 | | - """Configuration of the PPO update, mapped onto :class:`torchrl.objectives.ClipPPOLoss`.""" |
| 26 | + """PPO hyper-parameters, mapped onto :class:`torchrl.objectives.ClipPPOLoss` and GAE.""" |
27 | 27 |
|
28 | 28 | num_learning_epochs: int = MISSING |
29 | | - """Number of passes over the collected batch per iteration.""" |
30 | | - |
31 | 29 | num_mini_batches: int = MISSING |
32 | | - """Number of mini-batches the collected batch is split into per epoch.""" |
33 | | - |
34 | 30 | learning_rate: float = MISSING |
35 | | - """Adam learning rate.""" |
36 | | - |
37 | 31 | gamma: float = MISSING |
38 | | - """Discount factor.""" |
39 | | - |
40 | 32 | lam: float = MISSING |
41 | | - """GAE lambda.""" |
42 | | - |
43 | 33 | clip_param: float = 0.2 |
44 | | - """PPO clipping range for the probability ratio.""" |
45 | | - |
46 | 34 | entropy_coef: float = 0.0 |
47 | | - """Weight of the entropy bonus. ``0`` disables it.""" |
48 | | - |
| 35 | + """Weight of the entropy bonus; ``0`` disables it.""" |
49 | 36 | value_loss_coef: float = 1.0 |
50 | | - """Weight of the value loss.""" |
51 | | - |
52 | 37 | max_grad_norm: float = 1.0 |
53 | | - """Gradient norm clipping threshold.""" |
54 | | - |
55 | 38 | normalize_advantage: bool = True |
56 | | - """Whether to normalize advantages within each mini-batch.""" |
| 39 | + """Normalize advantages within each mini-batch.""" |
57 | 40 |
|
58 | 41 |
|
59 | 42 | @configclass |
60 | 43 | class TorchRlPpoRunnerCfg: |
61 | 44 | """Configuration of :class:`~isaaclab_rl.torchrl.TorchRlPpoRunner`.""" |
62 | 45 |
|
63 | 46 | seed: int = 42 |
64 | | - """Seed for the environment and the networks.""" |
65 | | - |
66 | 47 | device: str = "cuda:0" |
67 | | - """Device the networks and the collected batches live on.""" |
68 | | - |
69 | 48 | num_steps_per_env: int = MISSING |
70 | 49 | """Environment steps collected from every environment per iteration.""" |
71 | | - |
72 | 50 | max_iterations: int = MISSING |
73 | | - """Number of training iterations.""" |
74 | | - |
75 | 51 | save_interval: int = MISSING |
76 | 52 | """Iterations between checkpoints.""" |
77 | | - |
78 | 53 | experiment_name: str = MISSING |
79 | 54 | """Name of the experiment folder under ``logs/torchrl``.""" |
80 | | - |
81 | 55 | run_name: str = "" |
82 | | - """Optional suffix appended to the timestamped run folder.""" |
83 | | - |
| 56 | + """Optional suffix of the timestamped run folder.""" |
84 | 57 | clip_actions: float | None = None |
85 | | - """Clipping range applied to actions before they reach the environment. ``None`` disables clipping.""" |
86 | | - |
| 58 | + """Clipping range applied to actions before they reach the environment; ``None`` disables it.""" |
87 | 59 | init_noise_std: float = 1.0 |
88 | 60 | """Initial standard deviation of the Gaussian policy.""" |
89 | | - |
90 | 61 | actor: TorchRlMlpModelCfg = MISSING |
91 | | - """Actor network.""" |
92 | | - |
93 | 62 | critic: TorchRlMlpModelCfg = MISSING |
94 | | - """Critic network. It reads the ``"critic"`` observation group when the task defines one, else ``"policy"``.""" |
95 | | - |
| 63 | + """Reads the ``"critic"`` observation group when the task defines one, else ``"policy"``.""" |
96 | 64 | algorithm: TorchRlPpoAlgorithmCfg = MISSING |
97 | | - """PPO hyper-parameters.""" |
0 commit comments