lact
lact
¶
Latent Action Transformer (LACT) architecture for action decoding.
LACT is an Action Transformer with latent-conditioned decoding through adaptive normalization.
LACT
¶
LACT(input_keys, action_space, action_heads, observation_space, observation_horizon, prediction_horizon, device, latent_dimension, embedding_dimension=256, number_of_heads=8, number_of_key_value_heads=None, feedforward_dimension=None, number_of_layers=6, activation=value, normalization_type=value, attention_type=value, positional_encoding_type=value, dropout_rate=0.1, attention_dropout=0.0, use_gating=True)
Bases: BaseParallelTransformerDecoder
Latent Action Transformer for generative action decoding.
Forward pass steps
Build observation tokens from spatial/flat features Condition learnable queries with latent via AdaLN-Zero Decode actions cross-attention to observation tokens with latent modulation at each layer Apply action heads to produce predictions
Initialize LACT 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 |
action_heads
|
dict[str, ActionHead]
|
Dictionary of action prediction heads |
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 |
latent_dimension
|
int
|
Dimension of latent conditioning vector |
required |
embedding_dimension
|
int
|
Transformer hidden dimension |
256
|
number_of_heads
|
int
|
Number of attention heads |
8
|
number_of_key_value_heads
|
int | None
|
Number of K/V heads for GQA (None for MHA) |
None
|
feedforward_dimension
|
int | None
|
FFN hidden dimension (default: 4 * embedding_dimension) |
None
|
number_of_layers
|
int
|
Number of conditional transformer decoder layers |
6
|
activation
|
str
|
Activation function name |
value
|
normalization_type
|
str
|
Type of adaptive normalization layer |
value
|
attention_type
|
str
|
Type of attention mechanism (multi-head, grouped query, etc.) |
value
|
positional_encoding_type
|
str | None
|
Type of positional encoding. |
value
|
dropout_rate
|
float
|
Dropout probability for residual connections |
0.1
|
attention_dropout
|
float
|
Dropout probability for attention weights |
0.0
|
use_gating
|
bool
|
Whether to use AdaLN-Zero gating on residual connections |
True
|
Source code in src/versatil/models/decoding/decoders/factory/lact.py
forward
¶
Forward pass of LACT architecture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
dict[str, Tensor]
|
Dictionary of encoded features from EncodingPipeline. Must contain LatentKey.POSTERIOR_LATENT.value with shape (B, latent_dimension). |
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) |
Raises:
| Type | Description |
|---|---|
ValueError
|
If LatentKey.POSTERIOR_LATENT.value is not present in features |