-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Update the template generator for RSL-RL #6806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Internal: updated template generator tests for RSL-RL Distillation support. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). | ||
| # All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| from isaaclab.utils.configclass import configclass | ||
|
|
||
| from isaaclab_rl.rsl_rl import RslRlDistillationAlgorithmCfg, RslRlDistillationRunnerCfg, RslRlMLPModelCfg | ||
|
|
||
|
|
||
| @configclass | ||
| class DistillationRunnerCfg(RslRlDistillationRunnerCfg): | ||
| num_steps_per_env = 60 | ||
| max_iterations = 150 | ||
| save_interval = 50 | ||
| experiment_name = "cartpole_direct" | ||
| obs_groups = {"student": ["policy"], "teacher": ["policy"]} | ||
| student = RslRlMLPModelCfg( | ||
| hidden_dims=[32, 32], | ||
| activation="elu", | ||
| obs_normalization=False, | ||
| distribution_cfg=RslRlMLPModelCfg.GaussianDistributionCfg(init_std=1.0), | ||
| ) | ||
| teacher = RslRlMLPModelCfg( | ||
| hidden_dims=[32, 32], | ||
| activation="elu", | ||
| obs_normalization=False, | ||
| distribution_cfg=RslRlMLPModelCfg.GaussianDistributionCfg(init_std=0.0), | ||
| ) | ||
| algorithm = RslRlDistillationAlgorithmCfg( | ||
| num_learning_epochs=2, | ||
| learning_rate=1.0e-3, | ||
| gradient_length=15, | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,8 @@ gym.register( | |
| {% for algorithm in rl_library.algorithms %} | ||
| {# configuration file #} | ||
| {% if rl_library.name == "rsl_rl" %} | ||
| {% set agent_config = "." ~ rl_library.name ~ "_" ~ algorithm ~ "_cfg:" ~ algorithm|upper ~ "RunnerCfg" %} | ||
| {% set runner_prefix = {"distillation": "Distillation"}.get(algorithm, algorithm|upper) %} | ||
| {% set agent_config = "." ~ rl_library.name ~ "_" ~ algorithm ~ "_cfg:" ~ runner_prefix ~ "RunnerCfg" %} | ||
|
Comment on lines
+30
to
+31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a project is generated with RSL-RL Distillation but without PPO, registration exposes only |
||
| {% else %} | ||
| {% set agent_config = ":" ~ rl_library.name ~ "_" ~ algorithm ~ "_cfg.yaml" %} | ||
| {% endif %} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
DISTILLATIONchanges the discovered RSL-RL single-agent algorithms to["DISTILLATION", "PPO"], but the checked-in discovery tests still expect only["PPO"], causingtest_get_algorithms_per_rl_library_filters_by_workflow_typeto fail.