act
act
¶
Action Chunking Transformer (ACT) architecture for action decoding.
Reference: https://arxiv.org/abs/2304.13705
ACT
¶
ACT(input_keys, action_space, action_heads, observation_space, observation_horizon, prediction_horizon, device, embedding_dimension=256, number_of_heads=8, feedforward_dimension=512, number_of_encoder_layers=6, number_of_decoder_layers=6, activation=value, dropout_rate=0.1, normalize_before=False)
Bases: BaseParallelTransformerDecoder
Action Chunking Transformer network for action decoding.
This architecture: - Encodes multi-camera images into spatial features - Optionally accepts a latent embedding from the algorithm layer (e.g., from VAE) - Convert flat and spatial features into a sequence of token embeddings with shared embedding dimension - Decodes actions in parallel using a DETR-style non-autoregressive transformer with learnable queries - Supports multiple action heads: position, orientation, gripper
Note: Latent action encoding is handled at the Algorithm level, not within this decoder. The decoder expects latent embeddings to be passed via the features dictionary with key LatentKey.POSTERIOR_LATENT.
Initialize ACT-style decoder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_keys
|
list[str]
|
List of feature keys expected from encoder pipeline |
required |
action_space
|
ActionSpace
|
Action space configuration |
required |
observation_space
|
ObservationSpace
|
Observation space configuration |
required |
observation_horizon
|
int
|
Number of observation timesteps |
required |
prediction_horizon
|
int
|
Number of actions to predict |
required |
device
|
str
|
Device to run the model on |
required |
embedding_dimension
|
int
|
Transformer hidden dimension |
256
|
number_of_heads
|
int
|
Number of attention heads |
8
|
feedforward_dimension
|
int
|
Feedforward network dimension |
512
|
number_of_encoder_layers
|
int
|
Number of transformer encoder layers |
6
|
number_of_decoder_layers
|
int
|
Number of transformer decoder layers |
6
|
activation
|
str
|
Activation function name |
value
|
dropout_rate
|
float
|
Dropout probability |
0.1
|
normalize_before
|
bool
|
Use pre-normalization |
False
|
Source code in src/versatil/models/decoding/decoders/factory/act.py
forward
¶
Forward pass of ACT architecture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
dict[str, Tensor]
|
Dictionary of encoded features from EncodingPipeline |
required |
actions
|
dict[str, Tensor] | None
|
Not used, present for API compatibility. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Tensor]
|
Dictionary containing action head predictions (e.g. position, orientation, gripper) |
Note
If LatentKey.POSTERIOR_LATENT is present in features, it will be used as an extra token embedding for the transformer cross-attention.