robomimic.config package#

Submodules#

robomimic.config.base_config module#

The base config class that is used for all algorithm configs in this repository. Subclasses get registered into a global dictionary, making it easy to instantiate the correct config class given the algorithm name.

class robomimic.config.base_config.BaseConfig(dict_to_load=None)#

Bases: robomimic.config.config.Config

property ALGO_NAME#

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom:

class C:

@classmethod def f(cls, arg1, arg2, …):

It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument.

Class methods are different than C++ or Java static methods. If you want those, see the staticmethod builtin.

algo_config()#

This function populates the config.algo attribute of the config, and is given to the Algo subclass (see algo/algo.py) for each algorithm through the algo_config argument to the constructor. Any parameter that an algorithm needs to determine its training and test-time behavior should be populated here. This function should be implemented by every subclass.

property all_obs_keys#

low_dim, rgb, depth, etc.) and over all modality groups (e.g: obs, goal, subgoal, etc…)

Returns

all observation keys used for this model

Return type

n-array

Type

This grabs the union of observation keys over all modalities (e.g.

experiment_config()#

This function populates the config.experiment attribute of the config, which has several experiment settings such as the name of the training run, whether to do logging, whether to save models (and how often), whether to render videos, and whether to do rollouts (and how often). This class has a default implementation that usually doesn’t need to be overriden.

observation_config()#

This function populates the config.observation attribute of the config, and is given to the Algo subclass (see algo/algo.py) for each algorithm through the obs_config argument to the constructor. This portion of the config is used to specify what observation modalities should be used by the networks for training, and how the observation modalities should be encoded by the networks. While this class has a default implementation that usually doesn’t need to be overriden, certain algorithm configs may choose to, in order to have seperate configs for different networks in the algorithm.

train_config()#

This function populates the config.train attribute of the config, which has several settings related to the training process, such as the dataset to use for training, and how the data loader should load the data. This class has a default implementation that usually doesn’t need to be overriden.

property use_goals#
class robomimic.config.base_config.ConfigMeta(name, bases, class_dict)#

Bases: type

Define a metaclass for constructing a config class. It registers configs into the global registry.

robomimic.config.base_config.config_factory(algo_name, dic=None)#

Creates an instance of a config from the algo name. Optionally pass a dictionary to instantiate the config from the dictionary.

robomimic.config.base_config.get_all_registered_configs()#

Give access to dictionary of all registered configs for external use.

robomimic.config.bc_config module#

Config for BC algorithm.

class robomimic.config.bc_config.BCConfig(dict_to_load=None)#

Bases: robomimic.config.base_config.BaseConfig

ALGO_NAME = 'bc'#
algo_config()#

This function populates the config.algo attribute of the config, and is given to the Algo subclass (see algo/algo.py) for each algorithm through the algo_config argument to the constructor. Any parameter that an algorithm needs to determine its training and test-time behavior should be populated here.

robomimic.config.bcq_config module#

Config for BCQ algorithm.

class robomimic.config.bcq_config.BCQConfig(dict_to_load=None)#

Bases: robomimic.config.base_config.BaseConfig

ALGO_NAME = 'bcq'#
algo_config()#

This function populates the config.algo attribute of the config, and is given to the Algo subclass (see algo/algo.py) for each algorithm through the algo_config argument to the constructor. Any parameter that an algorithm needs to determine its training and test-time behavior should be populated here.

robomimic.config.config module#

Basic config class - provides a convenient way to work with nested dictionaries (by exposing keys as attributes) and to save / load from jsons.

Based on addict: https://github.com/mewwts/addict

class robomimic.config.config.Config(*args, **kwargs)#

Bases: dict

copy() a shallow copy of D#
deepcopy()#
do_not_lock_keys()#

Calling this function on this config indicates that key updates should be allowed even when this config is key-locked (but not when it is completely locked). This is convenient for attributes that contain kwargs, where there might be a variable type and number of arguments contained in the sub-config.

dump(filename=None)#

Dumps the config to a json.

Parameters

filename (str) – if not None, save to json file.

Returns

json string representation of

this config

Return type

json_string (str)

property is_key_locked#

Returns True if the config is key-locked (no key updates allowed).

property is_locked#

Returns True if the config is locked (no key or value updates allowed).

property key_lockable#

Returns true if this config is key-lockable (new keys cannot be inserted in a key-locked lock level).

lock()#

Lock the config. Afterwards, new keys cannot be added to the config, and the values of existing keys cannot be modified.

lock_keys()#

Lock this config so that new keys cannot be added.

setdefault(key, default=None)#

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

to_dict()#
unlock()#

Unlock the config. Afterwards, new keys can be added to the config, and the values of existing keys can be modified.

unlock_keys()#

Unlock this config so that new keys can be added.

unlocked()#

A context scope for modifying a Config object. Within the scope, both keys and values can be updated. Upon leaving the scope, the initial level of locking is restored.

update(*args, **kwargs)#

Update this config using another config or nested dictionary.

values_unlocked()#

A context scope for modifying a Config object. Within the scope, only values can be updated (new keys cannot be created). Upon leaving the scope, the initial level of locking is restored.

robomimic.config.cql_config module#

Config for CQL algorithm.

class robomimic.config.cql_config.CQLConfig(dict_to_load=None)#

Bases: robomimic.config.base_config.BaseConfig

ALGO_NAME = 'cql'#
algo_config()#

This function populates the config.algo attribute of the config, and is given to the Algo subclass (see algo/algo.py) for each algorithm through the algo_config argument to the constructor. Any parameter that an algorithm needs to determine its training and test-time behavior should be populated here.

train_config()#

Update from superclass to change default batch size.

robomimic.config.gl_config module#

Config for Goal Learning (sub-algorithm used by hierarchical models like HBC and IRIS). This class of model predicts (or samples) subgoal observations given a current observation.

class robomimic.config.gl_config.GLConfig(dict_to_load=None)#

Bases: robomimic.config.base_config.BaseConfig

ALGO_NAME = 'gl'#
algo_config()#

This function populates the config.algo attribute of the config, and is given to the Algo subclass (see algo/algo.py) for each algorithm through the algo_config argument to the constructor. Any parameter that an algorithm needs to determine its training and test-time behavior should be populated here.

property all_obs_keys#

Update from superclass to include subgoals.

observation_config()#

Update from superclass to specify subgoal modalities.

robomimic.config.hbc_config module#

Config for HBC algorithm.

class robomimic.config.hbc_config.HBCConfig(dict_to_load=None)#

Bases: robomimic.config.base_config.BaseConfig

ALGO_NAME = 'hbc'#
algo_config()#

This function populates the config.algo attribute of the config, and is given to the Algo subclass (see algo/algo.py) for each algorithm through the algo_config argument to the constructor. Any parameter that an algorithm needs to determine its training and test-time behavior should be populated here.

property all_obs_keys#

Update from superclass to include modalities from planner and actor.

observation_config()#

Update from superclass so that planner and actor each get their own observation config.

train_config()#

Update from superclass to change default sequence length to load from dataset.

property use_goals#

Update from superclass - planner goal modalities determine goal-conditioning

robomimic.config.iris_config module#

Config for IRIS algorithm.

class robomimic.config.iris_config.IRISConfig(dict_to_load=None)#

Bases: robomimic.config.hbc_config.HBCConfig

ALGO_NAME = 'iris'#
algo_config()#

This function populates the config.algo attribute of the config, and is given to the Algo subclass (see algo/algo.py) for each algorithm through the algo_config argument to the constructor. Any parameter that an algorithm needs to determine its training and test-time behavior should be populated here.

property all_obs_keys#

Update from superclass to include modalities from value planner and actor.

observation_config()#

Update from superclass so that value planner and actor each get their own obs config.

property use_goals#

Update from superclass - value planner goal modalities determine goal-conditioning.

robomimic.config.td3_bc_config module#

Config for TD3_BC.

class robomimic.config.td3_bc_config.TD3_BCConfig(dict_to_load=None)#

Bases: robomimic.config.base_config.BaseConfig

ALGO_NAME = 'td3_bc'#
algo_config()#

This function populates the config.algo attribute of the config, and is given to the Algo subclass (see algo/algo.py) for each algorithm through the algo_config argument to the constructor. Any parameter that an algorithm needs to determine its training and test-time behavior should be populated here.

experiment_config()#

Update from subclass to set paper defaults for gym envs.

observation_config()#

Update from superclass to use flat observations from gym envs.

train_config()#

Update from subclass to set paper defaults for gym envs.

Module contents#