Skip to content

Best practice to customize teacher/actor/critic networks #135

@alaurenzi

Description

@alaurenzi

Dear developers,
What is the best practice to have RSLRL runners load a custom network (module)?

From a quick look to the code, it looks like RSLRL relies on a class_name attribute inside the policy config dataclass, which is then passed to python's built-in eval:

student_teacher_class = eval(self.policy_cfg.pop("class_name"))

This however relies on the runner having pre-imported the required python module

from rsl_rl.modules import ActorCritic, ActorCriticRecurrent, resolve_rnd_config, resolve_symmetry_config

I believe this make it more difficult for users to inject their custom modules, but maybe I've missed something.

We're now experimenting with swapping class_name with class_type (in the same spirit of IsaacLab's config dataclasses), which returns a handle to a class that the user can freely set at configuration time.

student_teacher_class = self.policy_cfg["class_type"]  # or something similar

Thanks for your help!

Arturo

@lucarossini-iit

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions