Learning Options¶
Typed options for the RL runners. A task's runner_options holds one; Eden translates it into the configuration
dict the installed library version expects, so a task on rsl_rl's own algorithms trains on every rsl-rl-lib version
the pin admits (>=3.0). Some of Eden's own algorithms need newer: AMP-PPO and RMA need 5.5.1
(MIN_RSL_RL_VERSION in eden.learning.wrappers.rsl_rl), and the flashsac extra 5.4.2, while HIM adapts itself to
3.x (see
Across rsl-rl-lib versions).
The training runs guide explains runners, checkpoints and resuming; the algorithms
Eden adds on top of a library are on the learning page.
rsl_rl¶
Models, distributions and PPO¶
rsl_rl model, distribution, and PPO configuration options.
Attributes¶
Classes¶
RslRlDistributionOptions
¶
Bases: ConfigurableOptions
Base configuration for an output distribution.
| PARAMETER | DESCRIPTION |
|---|---|
class_name
|
The distribution class name.
|
Source code in eden/options/options.py
RslRlGaussianDistributionOptions
¶
Bases: RslRlDistributionOptions
Configuration for a state-independent Gaussian distribution.
| PARAMETER | DESCRIPTION |
|---|---|
class_name
|
The distribution class name.
|
init_std
|
Initial standard deviation.
|
std_type
|
Parameterisation of the standard deviation.
|
std_range
|
Hard rsl-rl >= 5 only. The v3.2 and v4 translators
(:mod:
|
Source code in eden/options/options.py
Attributes¶
RslRlHeteroscedasticGaussianDistributionOptions
¶
Bases: RslRlDistributionOptions
Configuration for a state-dependent (heteroscedastic) Gaussian distribution.
The MLP outputs both mean and standard deviation. The init_std
value is used to initialise the bias of the std head.
| PARAMETER | DESCRIPTION |
|---|---|
class_name
|
The distribution class name.
|
init_std
|
Initial standard deviation (used to initialise MLP std-head bias).
|
std_type
|
Parameterisation of the standard deviation.
|
Source code in eden/options/options.py
RslRlModelOptions
¶
Bases: ConfigurableOptions
Configuration for an rsl_rl model.
| PARAMETER | DESCRIPTION |
|---|---|
class_name
|
The rsl_rl class name. This parameter should not be overridden.
|
hidden_dims
|
Hidden layer dimensions for the MLP trunk.
|
activation
|
Activation function.
|
obs_normalization
|
Whether to normalize observations before the network.
|
Source code in eden/options/options.py
Attributes¶
RslRlModelWithDistributionOptions
¶
Bases: RslRlModelOptions
Mixin for models with a distribution.
| PARAMETER | DESCRIPTION |
|---|---|
distribution_cfg
|
Output distribution.
|
Source code in eden/options/options.py
Attributes¶
distribution_cfg
class-attribute
instance-attribute
¶
distribution_cfg: RslRlDistributionOptions | None = RslRlGaussianDistributionOptions()
RslRlRNNModelOptions
¶
Bases: RslRlModelOptions
Configuration for a recurrent (RNN) model.
Source code in eden/options/options.py
Attributes¶
RslRlCNNModelOptions
¶
Bases: RslRlModelOptions
Configuration for a CNN-backed model.
Source code in eden/options/options.py
RslRlActorRNNOptions
¶
Bases: RslRlRNNModelOptions, RslRlModelWithDistributionOptions
Recurrent policy actor.
Source code in eden/options/options.py
RslRlActorCNNOptions
¶
Bases: RslRlCNNModelOptions, RslRlModelWithDistributionOptions
CNN policy actor.
Source code in eden/options/options.py
RslRlPpoAlgorithmOptions
¶
Bases: ConfigurableOptions
Configuration for the PPO algorithm.
| PARAMETER | DESCRIPTION |
|---|---|
class_name
|
The algorithm class name.
|
num_learning_epochs
|
The number of learning epochs per update.
|
num_mini_batches
|
The number of mini-batches per update.
|
learning_rate
|
The learning rate for the policy.
|
schedule
|
The learning rate schedule.
|
gamma
|
The discount factor.
|
lam
|
The lambda parameter for Generalized Advantage Estimation (GAE).
|
entropy_coef
|
The coefficient for the entropy loss.
|
desired_kl
|
The desired KL divergence.
|
max_grad_norm
|
The maximum gradient norm.
|
value_loss_coef
|
The coefficient for the value loss.
|
use_clipped_value_loss
|
Whether to use clipped value loss.
|
clip_param
|
The clipping parameter for the policy.
|
normalize_advantage_per_mini_batch
|
Whether to normalize the advantage per mini-batch.
|
share_cnn_encoders
|
Whether to share CNN encoders between actor and critic.
|
rnd_cfg
|
The RND configuration.
|
symmetry_cfg
|
The symmetry configuration.
|
Source code in eden/options/options.py
RslRlBaseRunnerOptions
¶
Bases: ConfigurableOptions
Base configuration of the runner.
| PARAMETER | DESCRIPTION |
|---|---|
seed
|
The seed for the experiment. Non-negative; see
|
device
|
The device for the rl-agent.
|
num_steps_per_env
|
The number of steps per environment per update.
|
max_iterations
|
The maximum number of iterations.
|
obs_groups
|
A mapping from observation sets to observation groups.
Keys are
|
clip_actions
|
Actions are clamped to
|
save_interval
|
The number of iterations between saves.
|
keep_last_checkpoints
|
How many of the run's newest
|
check_for_nan
|
Whether to check for NaN values in environment outputs.
|
experiment_name
|
The experiment name.
|
run_name
|
The run name.
|
logger
|
The logger to use.
|
neptune_project
|
The neptune project name.
|
wandb_project
|
The wandb project name.
|
resume
|
Whether to resume a previous training.
|
load_run
|
The run directory to load.
|
load_checkpoint
|
The checkpoint file to load.
|
Source code in eden/options/options.py
RslRlOnPolicyRunnerOptions
¶
Bases: RslRlBaseRunnerOptions
Configuration of the runner for on-policy algorithms.
The runner carries separate actor and critic model configs.
| PARAMETER | DESCRIPTION |
|---|---|
class_name
|
The runner class name.
|
actor
|
The actor model configuration with distribution to sample from.
|
critic
|
The critic model configuration.
|
algorithm
|
The algorithm configuration.
|
Source code in eden/options/options.py
Attributes¶
Distillation¶
rsl_rl distillation algorithm and runner configuration options.
Classes¶
RslRlDistillationAlgorithmOptions
¶
Bases: ConfigurableOptions
Configuration for the distillation algorithm.
| PARAMETER | DESCRIPTION |
|---|---|
class_name
|
The algorithm class name.
|
num_learning_epochs
|
The number of updates performed with each sample.
|
learning_rate
|
The learning rate for the student policy.
|
gradient_length
|
The number of environment steps the gradient flows back.
|
max_grad_norm
|
The maximum norm the gradient is clipped to.
|
optimizer
|
The optimizer to use.
|
loss_type
|
The loss type.
|
Source code in eden/options/options.py
RslRlDistillationRunnerOptions
¶
Bases: RslRlBaseRunnerOptions
Configuration of the runner for distillation algorithms.
| PARAMETER | DESCRIPTION |
|---|---|
class_name
|
The runner class name.
|
student
|
The student model configuration with distribution to sample from.
|
teacher
|
The teacher model configuration.
|
algorithm
|
The algorithm configuration.
|
Source code in eden/options/options.py
Attributes¶
Random network distillation¶
rsl_rl Random Network Distillation (RND) configuration options.
Classes¶
RslRlRndWeightScheduleOptions
¶
Bases: ConfigurableOptions
Configuration for the weight schedule.
| PARAMETER | DESCRIPTION |
|---|---|
mode
|
The type of weight schedule.
|
Source code in eden/options/options.py
RslRlRndLinearWeightScheduleOptions
¶
Bases: RslRlRndWeightScheduleOptions
Configuration for the linear weight schedule.
This schedule decays the weight linearly from the initial value to the final value between initial_step and before final_step.
| PARAMETER | DESCRIPTION |
|---|---|
mode
|
The type of weight schedule.
|
final_value
|
The final value of the weight parameter.
|
initial_step
|
The initial step of the weight schedule. For steps before this step, the weight is the initial value specified in RslRlRndOptions.weight.
|
final_step
|
The final step of the weight schedule. For steps after this step, the weight is the final value specified in final_value.
|
Source code in eden/options/options.py
RslRlRndStepWeightScheduleOptions
¶
Bases: RslRlRndWeightScheduleOptions
Configuration for the step weight schedule.
This schedule sets the weight to the value specified in final_value at step final_step.
| PARAMETER | DESCRIPTION |
|---|---|
mode
|
The type of weight schedule.
|
final_step
|
The final step of the weight schedule. For steps after this step, the weight is the value specified in final_value.
|
final_value
|
The final value of the weight parameter.
|
Source code in eden/options/options.py
RslRlRndOptions
¶
Bases: ConfigurableOptions
Configuration for the Random Network Distillation (RND) module.
For more information, please check the work from :cite:schwarke2023curiosity.
| PARAMETER | DESCRIPTION |
|---|---|
weight
|
The weight for the RND reward (also known as intrinsic reward). Similar to other reward terms, the RND reward is scaled by this weight.
|
weight_schedule
|
The weight schedule for the RND reward. Default is None, which means the weight is constant.
|
reward_normalization
|
Whether to normalize the RND reward.
|
state_normalization
|
Whether to normalize the RND state.
|
learning_rate
|
The learning rate for the RND module.
|
num_outputs
|
The number of outputs for the RND module.
|
predictor_hidden_dims
|
The hidden dimensions for the RND predictor network. If the list contains -1, then the hidden dimensions are the same as the input dimensions.
|
target_hidden_dims
|
The hidden dimensions for the RND target network. If the list contains -1, then the hidden dimensions are the same as the input dimensions.
|
Source code in eden/options/options.py
Attributes¶
weight_schedule
class-attribute
instance-attribute
¶
weight_schedule: RslRlRndWeightScheduleOptions | None = None
Symmetry augmentation¶
rsl_rl symmetry-augmentation configuration options.
Classes¶
RslRlSymmetryOptions
¶
Bases: ConfigurableOptions
Configuration for the symmetry-augmentation in the training.
When use_data_augmentation is True, the data_augmentation_func is used to generate augmented observations and actions. These are then used to train the model.
When use_mirror_loss is True, the mirror_loss_coeff is used to weight the symmetry-mirror loss. This loss is directly added to the agent's loss function.
If both use_data_augmentation and use_mirror_loss are False, then no symmetry-based training is enabled. However, the data_augmentation_func is called to compute and log symmetry metrics. This is useful for performing ablations.
For more information, please check the work from :cite:mittal2024symmetry.
| PARAMETER | DESCRIPTION |
|---|---|
use_data_augmentation
|
Whether to use symmetry-based data augmentation.
|
use_mirror_loss
|
Whether to use the symmetry-augmentation loss.
|
data_augmentation_func
|
Not declared as a field yet (commented out below), so these options reject it; an algorithm that
takes one declares its own (
It returns a tuple of the augmented observation dictionary and action tensors, either of which can be None if its respective input was None.
|
mirror_loss_coeff
|
The weight for the symmetry-mirror loss.
|
Source code in eden/options/options.py
Spatial-softmax CNN¶
CNN policy head with a spatial-softmax pooling layer.
Spatial softmax (Levine et al. 2016, "End-to-End Training of Deep Visuomotor
Policies") replaces the flatten at the end of a conv stack with a soft-argmax
over each channel's feature map, returning the expected (x, y) location of
every channel — i.e. explicit 2D keypoint coordinates. For a grasp/lift task
this hands the policy the object's image-space position directly instead of
forcing the MLP trunk to recover it from a flattened feature vector, which is
what makes vision manipulation learnable from scratch.
:class:SpatialSoftmaxCNNModel is a drop-in replacement for rsl_rl's
CNNModel: point an actor/critic class_name at
eden.options.learning.rsl_rl.spatial_softmax:SpatialSoftmaxCNNModel and pass
a cnn_cfg with spatial_softmax: True (see
eden/tasks/manipulation/lift_box_rgb/config.py). Built on the stock
rsl_rl.modules.CNN / rsl_rl.models.{CNNModel,MLPModel} APIs, so it tracks
whatever rsl_rl version eden resolves.
Classes¶
SpatialSoftmax
¶
Bases: Module
Spatial soft-argmax over feature maps.
Given input of shape (B, C, H, W), computes a softmax over each channel's
spatial locations and returns the expected (x, y) coordinates, yielding
output shape (B, C * 2).
Args: height: Height of the input feature maps. width: Width of the input feature maps. temperature: Temperature for the spatial softmax. Lower values produce sharper distributions.
Source code in eden/options/learning/rsl_rl/spatial_softmax.py
Attributes¶
Methods:¶
forward
¶
Source code in eden/options/learning/rsl_rl/spatial_softmax.py
SpatialSoftmaxCNN
¶
SpatialSoftmaxCNN(input_dim: tuple[int, int], input_channels: int, temperature: float = 1.0, **cnn_kwargs: Any)
Bases: Module
CNN encoder with spatial-softmax pooling.
Wraps rsl_rl.modules.CNN (created with global_pool="none" and
flatten=False) followed by :class:SpatialSoftmax. Exposes the same
interface as CNN: :attr:output_dim (int) and :attr:output_channels
(None, signalling flattened output).
Args:
input_dim: (H, W) of the input images.
input_channels: Number of input channels.
temperature: Temperature for the spatial softmax.
**cnn_kwargs: Remaining keyword arguments forwarded to rsl_rl.modules.CNN.
Source code in eden/options/learning/rsl_rl/spatial_softmax.py
SpatialSoftmaxCNNModel
¶
SpatialSoftmaxCNNModel(obs: TensorDict, obs_groups: dict[str, list[str]], obs_set: str, output_dim: int, cnn_cfg: dict[str, dict] | dict[str, Any], cnns: ModuleDict | None = None, hidden_dims: tuple[int] | list[int] = [256, 256, 256], activation: str = 'elu', obs_normalization: bool = False, distribution_cfg: dict[str, Any] | None = None)
Bases: CNNModel
CNN model that uses spatial-softmax pooling.
Drop-in replacement for rsl_rl.models.CNNModel. The only difference is
that each CNN encoder is wrapped with :class:SpatialSoftmaxCNN instead of a
plain CNN. The spatial_softmax / spatial_softmax_temperature keys
are stripped from cnn_cfg before the rest is forwarded to the CNN.
Source code in eden/options/learning/rsl_rl/spatial_softmax.py
Version translation¶
Helpers that detect the installed rsl-rl-lib version and translate the typed options into the runner dict it expects.
Translation functions between rsl_rl config versions.
These functions convert the canonical v5-style runner dict (separate
actor / critic with distribution_cfg) into the formats
expected by older rsl_rl versions.
Typical usage::
from eden.options.learning.rsl_rl.translate import translate_runner_dict
runner_dict = translate_runner_dict(config.runner_options.dict()) # auto-detect
runner = OnPolicyRunner(env, runner_dict, ...)
Functions:¶
detect_rsl_rl_major_version
cached
¶
detect_rsl_rl_major_version() -> int
Return the major version of the installed rsl-rl-lib package.
Falls back to 3 if the package metadata is unavailable (e.g. editable
install from source without version).
Source code in eden/options/learning/rsl_rl/translate.py
detect_rsl_rl_version
cached
¶
Return the installed rsl-rl-lib release as a tuple ((5, 5, 1)), for checks finer than the major.
Falls back to (3,), as :func:detect_rsl_rl_major_version does, if the package metadata is unavailable.
Source code in eden/options/learning/rsl_rl/translate.py
require_rsl_rl_version
¶
Raise an ImportError that names the upgrade when the installed rsl-rl-lib is older than minimum.
Called at the top of a module before its rsl_rl imports, so an older install reads "upgrade to X" rather than
cannot import name ... from inside rsl_rl.
| PARAMETER | DESCRIPTION |
|---|---|
minimum
|
The oldest release the module runs on. |
module
|
The module's dotted name, for the message.
TYPE:
|
needs
|
What it uses that older releases lack, for the message.
TYPE:
|
Source code in eden/options/learning/rsl_rl/translate.py
translate_runner_dict
¶
Translate runner_dict to whatever the installed rsl_rl version expects.
Auto-detects the installed rsl_rl version and translates from the canonical v5 format to whatever that version expects.
| PARAMETER | DESCRIPTION |
|---|---|
runner_dict
|
A runner configuration dict (v5-style with
TYPE:
|
algorithm
|
The runner's algorithm options. When they define
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
A runner dict compatible with the installed rsl_rl version. |
Source code in eden/options/learning/rsl_rl/translate.py
translate_runner_dict_to_v3
¶
Convert a v5-style runner dict to the v3.2 format.
v3.2 expects:
- A single "policy" dict with combined actor/critic fields
(actor_hidden_dims, critic_hidden_dims, init_noise_std, …).
- The actor observation set keyed as "policy" in obs_groups.
- No share_cnn_encoders or check_for_nan in the algorithm.
| PARAMETER | DESCRIPTION |
|---|---|
runner_dict
|
A runner configuration dict produced by
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
A v3.2-compatible runner dict. |
Source code in eden/options/learning/rsl_rl/translate.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
translate_runner_dict_to_v4
¶
Convert a v5-style runner dict to the v4 format.
v4 uses separated model dicts (like v5) — actor / critic for PPO,
student / teacher for distillation — but a model takes
stochastic, init_noise_std, noise_std_type,
state_dependent_std instead of distribution_cfg. Both v4 runners
splat each model dict straight into MLPModel.__init__, so an
untranslated distribution_cfg is a TypeError there.
| PARAMETER | DESCRIPTION |
|---|---|
runner_dict
|
A runner configuration dict produced by
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
A v4-compatible runner dict. |
Source code in eden/options/learning/rsl_rl/translate.py
rl_games¶
rl_games network and PPO runner configuration options.
Attributes¶
Classes¶
RlGamesNetworkOptions
¶
Bases: ConfigurableOptions
Network architecture configuration for rl_games.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The network builder name.
|
separate
|
Whether actor and critic have separate network trunks.
|
units
|
Hidden layer sizes for the MLP.
|
activation
|
Activation function name.
|
mu_activation
|
Activation for the mean output head.
|
sigma_activation
|
Activation for the sigma output head.
|
fixed_sigma
|
Whether sigma is a fixed (learned) parameter or state-dependent.
|
init_sigma_val
|
Initial value for sigma (const initializer).
|
mu_init_name
|
Initializer name for mu weights.
|
Source code in eden/options/options.py
Attributes¶
RlGamesPpoRunnerOptions
¶
Bases: ConfigurableOptions
PPO runner configuration for rl_games.
Mirrors the params dict expected by :class:rl_games.torch_runner.Runner.
:func:~eden.options.learning.rl_games.translate.translate_runner_dict translates these options
into the nested dict that Runner.load() consumes.
| PARAMETER | DESCRIPTION |
|---|---|
seed
|
Random seed. Non-negative; see
|
experiment_name
|
Name for the experiment (used in log/checkpoint dirs).
|
device
|
Torch device string.
|
max_epochs
|
Maximum number of training epochs.
|
save_frequency
|
Save checkpoint every N epochs. 0 disables periodic saving.
|
keep_last_checkpoints
|
How many of the run's newest periodic
|
horizon_length
|
Number of environment steps per rollout.
|
mini_epochs
|
Number of PPO optimisation passes per rollout.
|
minibatch_size
|
Minibatch size. If
|
learning_rate
|
Initial learning rate.
|
lr_schedule
|
Learning-rate schedule (
|
kl_threshold
|
Target KL divergence for adaptive LR.
|
gamma
|
Discount factor.
|
tau
|
GAE lambda.
|
e_clip
|
PPO clipping parameter.
|
clip_value
|
Whether to clip value-function loss.
|
entropy_coef
|
Entropy bonus coefficient.
|
critic_coef
|
Value-loss coefficient.
|
grad_norm
|
Maximum gradient norm for clipping.
|
truncate_grads
|
Whether to clip gradients.
|
normalize_input
|
Whether to normalize observations with running statistics.
|
normalize_value
|
Whether to normalize value targets.
|
normalize_advantage
|
Whether to normalize advantages.
|
value_bootstrap
|
Whether to bootstrap value on time-outs.
|
reward_scale
|
Multiplicative reward scale applied by the reward shaper.
|
clip_actions
|
Symmetric action clipping bound: a finite positive bound, or
|
bounds_loss_coef
|
Coefficient for the action-bounds regularisation loss.
|
obs_groups
|
Mapping from
|
agents
|
Names the agents of a multi-agent env, in order. Each name must be an observation
group, a reward group and an action term of the env, and the action terms must be
declared in this same order. rl_games then trains one shared policy over
|
network
|
Network architecture.
|
torch_compile
|
|
Source code in eden/options/options.py
Attributes¶
lr_schedule
class-attribute
instance-attribute
¶
lr_schedule: Literal['adaptive', 'linear', 'None'] = 'adaptive'
network
class-attribute
instance-attribute
¶
network: RlGamesNetworkOptions = RlGamesNetworkOptions()
Functions:¶
check_agents_options
¶
Raise ValueError if agents repeats a name or is set together with obs_groups.
Shared by the options validator and :class:~eden.envs.wrappers.rl_games_env.RlGamesVecEnvWrapper,
which re-checks because a field assigned after construction skips the validator.
Source code in eden/options/learning/rl_games/rl.py
Translation from Eden rl_games options to the nested dict rl_games expects.
Typical usage::
from eden.options.learning.rl_games.translate import translate_runner_dict
runner_dict = translate_runner_dict(config.runner_options.dict(), num_envs=env.num_envs)
from rl_games.torch_runner import Runner
runner = Runner()
runner.load(runner_dict)
Functions:¶
translate_runner_dict
¶
Convert a flat Eden options dict into the nested params dict rl_games expects.
The output matches what rl_games.torch_runner.Runner.load() expects.
| PARAMETER | DESCRIPTION |
|---|---|
runner_dict
|
A dict produced by |
num_envs
|
Number of parallel environments (injected by the wrapper).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
The full |
Source code in eden/options/learning/rl_games/translate.py
Action clipping¶
The clip_actions bound that a runner's options and every env wrapper accept.
The action bound a runner's options and every env wrapper accept: clip_actions.
Attributes¶
ClipActions
module-attribute
¶
ClipActions = Annotated[float, AfterValidator(validate_clip_actions)]
Functions:¶
validate_clip_actions
¶
Return clip_actions if it is a finite positive bound, raising otherwise.
Actions are clamped to [-clip_actions, clip_actions]: zero would clamp every action to zero, a
negative bound inverts the interval, and an infinite or NaN one bounds nothing while promising a
bound to a library that reads the action space. field is where the caller set it, for the message.