Overview
ACT (Action Chunking Transformer) is a policy designed for fine-grained bimanual manipulation tasks. It uses a transformer architecture with a variational objective to predict chunks of actions, making it particularly effective for complex manipulation tasks that require precise control. The policy was introduced in Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware and is optimized for bimanual robots like ALOHA.Key Features
- Action Chunking: Predicts multiple future actions at once (default: 100 steps)
- Variational Objective: Uses a VAE to capture multimodal action distributions
- Vision Backbone: ResNet-based image encoding with configurable backbone
- Temporal Ensembling: Optional exponential weighting scheme for smoother action execution
- Transformer Architecture: Encoder-decoder structure with configurable layers and dimensions
Architecture
The ACT architecture consists of:- Vision Backbone: ResNet (default: ResNet18) for encoding camera observations
- Transformer Encoder: Processes visual and proprioceptive observations (default: 4 layers)
- Transformer Decoder: Generates action predictions (default: 1 layer due to original implementation bug)
- VAE Encoder (optional): Additional transformer for variational training (default: 4 layers)
Training
Basic Training Command
Training with Custom Configuration
Python API Training Example
Configuration Parameters
Input/Output Structure
int
default:"1"
Number of observation steps to pass to the policy. Currently only supports 1.
int
default:"100"
Size of action prediction chunks in environment steps.
int
default:"100"
Number of action steps to execute per policy invocation. Must be ≤ chunk_size.
Vision Backbone
str
default:"resnet18"
ResNet variant to use for image encoding (e.g., “resnet18”, “resnet34”).
str | None
default:"ResNet18_Weights.IMAGENET1K_V1"
Pretrained weights from torchvision. Set to
None for random initialization.bool
default:"false"
Whether to replace ResNet’s final 2x2 stride with dilated convolution.
Transformer Architecture
int
default:"512"
Main hidden dimension of the transformer blocks.
int
default:"8"
Number of attention heads in transformer blocks.
int
default:"3200"
Dimension of feed-forward layers in transformer blocks.
str
default:"relu"
Activation function in feed-forward layers.
int
default:"4"
Number of transformer encoder layers.
int
default:"1"
Number of transformer decoder layers. Set to 1 to match original implementation.
bool
default:"false"
Whether to use pre-normalization in transformer blocks.
float
default:"0.1"
Dropout rate in transformer layers.
VAE Configuration
bool
default:"true"
Whether to use variational objective during training.
int
default:"32"
Dimensionality of the VAE latent space.
int
default:"4"
Number of transformer layers in the VAE encoder.
float
default:"10.0"
Weight for KL-divergence loss component. Total loss = reconstruction_loss + kl_weight * kld_loss.
Inference
float | None
default:"null"
Coefficient for exponential temporal ensembling (typical value: 0.01). When enabled, n_action_steps must be 1.
Optimization
float
default:"1e-5"
Learning rate for the optimizer.
float
default:"1e-4"
Weight decay for the optimizer.
float
default:"1e-5"
Learning rate for the vision backbone (can be set separately).
Normalization
dict
Normalization mode for each feature type. Default:
{"VISUAL": "MEAN_STD", "STATE": "MEAN_STD", "ACTION": "MEAN_STD"}Usage Example
Loading a Pretrained Model
Inference with Temporal Ensembling
File Locations
Source files in the LeRobot repository:- Configuration:
src/lerobot/policies/act/configuration_act.py - Model:
src/lerobot/policies/act/modeling_act.py - Processor:
src/lerobot/policies/act/processor_act.py - Examples:
examples/tutorial/act/