Principle:ARISE Initiative Robomimic Configuration Setup
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Configuration, Experiment_Management |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
A registry-based configuration pattern that creates algorithm-specific experiment configurations from a name string, enabling polymorphic instantiation of hyperparameters, training settings, and observation specifications.
Description
Configuration Setup is the foundational step in any robomimic workflow. It uses a metaclass-based registry pattern where each algorithm config class (e.g., BCConfig, BCQConfig, CQLConfig) is automatically registered upon class definition. A factory function then resolves an algorithm name string (e.g., "bc", "bcq") to the appropriate config class and instantiates it, optionally loading parameters from a JSON dictionary.
This pattern solves the problem of managing diverse hyperparameter spaces across multiple algorithm families (imitation learning, offline RL, hierarchical) while maintaining a unified interface. Each config subclass defines its own default values and structure, ensuring that algorithm-specific parameters (e.g., BCQ's latent space dimensionality vs. CQL's conservative penalty weight) coexist without collision.
The config object uses a key-locking mechanism that prevents accidental introduction of misspelled or undefined parameters, catching common configuration errors at initialization rather than at training time.
Usage
Use this principle at the beginning of any training, evaluation, or hyperparameter sweep workflow. It is the required first step before observation initialization, dataset loading, or algorithm instantiation. Configuration setup is needed whenever you want to programmatically define experiment parameters or load them from a JSON template.
Theoretical Basis
The Configuration Setup principle relies on two design patterns:
1. Registry Pattern via Metaclass:
A metaclass intercepts class creation and registers each config subclass into a global dictionary keyed by algorithm name. This eliminates explicit registration calls and ensures every config class is discoverable.
# Abstract pattern (not real implementation)
REGISTRY = {}
class ConfigMeta(type):
def __new__(meta, name, bases, class_dict):
cls = super().__new__(meta, name, bases, class_dict)
if hasattr(cls, 'ALGO_NAME'):
REGISTRY[cls.ALGO_NAME] = cls
return cls
def config_factory(algo_name, dic=None):
return REGISTRY[algo_name](dict_to_load=dic)
2. Key-Locking Config:
Once a config is fully initialized, its keys are locked. Any attempt to access or set an undefined key raises an error, preventing silent configuration bugs.