Official LeRobot ACT and PushCube#
The ACT integration uses LeRobot 0.6.1 on Python 3.12. EmbodiChain owns collection, declared action contracts, corpus provenance and simulator evaluation. LeRobot owns its model, processors, training loop and native checkpoints. The example invokes the upstream trainer directly; it does not use the shared SL trainer.
Load a pretrained_model directory with its embodichain_act.json manifest.
Call reset() after every environment reset. The adapter returns physical
commands on the requested device and uses the official temporal ensemble.
Historical EmbodiChain ACT .pt checkpoints require retraining.
Run the upstream policy and its frozen processors on the simulation device. |
|
Build an upstream training config with explicit observation/action semantics. |
|
Hash recorded metadata and frame/media content without loading the corpus. |
|
Load a native ACT directory with its processors and EmbodiChain contract. |
|
Hash the portable native policy artifact, including processor statistics. |
|
Run the upstream policy and its frozen processors on the simulation device. |
|
|
Load a native ACT directory with its processors and EmbodiChain contract. |
|
Hash the portable native policy artifact, including processor statistics. |
|
Build an upstream training config with explicit observation/action semantics. |
|
Hash recorded metadata and frame/media content without loading the corpus. |
- class embodichain_models.policy.act.ACTInferencePolicy[source]#
Run the upstream policy and its frozen processors on the simulation device.
- Parameters:
policy (
Any) – Official LeRobot ACTPolicy.preprocessor (
Any) – Official observation processor pipeline.postprocessor (
Any) – Official action processor pipeline.metadata (
Mapping[str,Any]) – Task, data and action identities associated with training.
Methods:
__init__(policy, preprocessor, ...)evaluate_dataset(root, *[, batch_size, samples])Measure prior-prediction L1 on independent recorded action windows.
reset()Forget action chunks and ensemble history at every environment reset.
select_action(rgb, state)Return a physical action after the official temporal ensemble.
- evaluate_dataset(root, *, batch_size=32, samples=128)[source]#
Measure prior-prediction L1 on independent recorded action windows.
- Parameters:
root (
str|Path) – Validation dataset with the training observation/action schema.batch_size (
int) – Bounded evaluation minibatch size.samples (
int) – Maximum number of anchors, chosen with a fixed CPU seed.
- Return type:
dict[str,float]- Returns:
Normalized action L1 and number of valid supervised action elements.
- reset()[source]#
Forget action chunks and ensemble history at every environment reset.
- Return type:
None
- select_action(rgb, state)[source]#
Return a physical action after the official temporal ensemble.
- Parameters:
rgb (
Tensor) – Current uint8 RGB pixels, shaped[1, 3, H, W].state (
Tensor) – Current ordered joint state, shaped[1, state_dim].
- Return type:
Tensor- Returns:
Finite commands
[1, action_dim]on the policy device.
- embodichain_models.policy.act.build_act_train_config(dataset_root, output_dir, *, schema, image_key='observation.images.cam_high', device='cuda:0', seed=19001, updates=30000, batch_size=32, save_freq=2000, num_workers=4, smoke=False)[source]#
Build an upstream training config with explicit observation/action semantics.
- Parameters:
dataset_root (
str|Path) – Finalized training-only dataset; validation uses a separate root.output_dir (
str|Path) – New output directory owned by LeRobot.schema (
Mapping[str,Any]) – Ordered observation/action names, action semantics and control period.image_key (
str) – One recorded RGB camera feature.device (
str) – Torch training device.seed (
int) – Training seed.updates (
int) – Number of upstream optimizer updates.batch_size (
int) – Training minibatch size.save_freq (
int) – Upstream checkpoint interval.num_workers (
int) – Upstream DataLoader worker count.smoke (
bool) – Use a small uninitialized model for an engineering check.
- Return type:
TrainPipelineConfig- Returns:
LeRobot’s native config, ready for serialization and its official CLI.
- Raises:
ValueError – If the stored schema differs from the declared live control contract.
- embodichain_models.policy.act.dataset_fingerprint(root)[source]#
Hash recorded metadata and frame/media content without loading the corpus.
- Parameters:
root (
str|Path) – Finalized local LeRobot dataset directory.- Return type:
str- Returns:
SHA-256 binding relative filenames and file contents. SDK caches are excluded.
- embodichain_models.policy.act.load_act_policy(path, device='cpu', *, untrained=False)[source]#
Load a native ACT directory with its processors and EmbodiChain contract.
- Parameters:
path (
str|Path) – Native pretrained-model directory, includingembodichain_act.json.device (
str) – Target policy and action device.untrained (
bool) – Reinitialize the model with the original backbone initializer and frozen data statistics, for the untrained baseline.
- Return type:
- Returns:
Stateful single-environment inference adapter. Call reset after env.reset.
- Raises:
ValueError – If the directory is a historical custom ACT artifact or its task/processor manifest is missing or inconsistent.
- embodichain_models.policy.act.policy_fingerprint(path)[source]#
Hash the portable native policy artifact, including processor statistics.
- Parameters:
path (
str|Path) – LeRobot pretrained-model directory.- Return type:
str- Returns:
SHA-256 of filenames and contents, excluding the redundant run manifest.