nemo_automodel.components.models.praxis.action_expert
nemo_automodel.components.models.praxis.action_expert
Action expert: a small transformer that denoises the action tokens.
The expert reads the encoder’s input sequence (its global tokens) and the encoder block outputs at the tap blocks; it never writes back into the video stream. Its layers alternate cross attention (even layers, one tap each) and self attention (odd layers).
Expert query sequence::
[ proprio (1 per chunk) | future tokens (F per chunk) | action tokens (1 per noised frame) ]
Cross-attention key/value sequence::
[ global tokens (register, anchor, text) | clean frame tokens | noised frame tokens ]
Queries and keys turn by the trunk rotary positions before their RMS norm; the rotary position of a frame is the position of its first token.
Module Contents
Classes
Functions
API
Bases: Module
The action transformer (see the module docstring).
Predict the action velocity from the encoder features of one window.
Parameters:
Encoder taps and sequence layout of the window (batch size 1).
Noised action tokens of shape [1, K * F, action_patch_dim], chunk-major.
Flow time of each chunk, shape [1, K].
Normalized boundary pose of each chunk, shape [1, K, proprio_patch_dim].
Returns: Tensor
Action velocity of shape [1, K * F, action_patch_dim] in the taps dtype.
Bases: Module
One expert layer: cross or self attention, then a GEGLU MLP, each behind a scale-only AdaLN.
Run the layer.
Parameters:
Expert tokens of shape [batch, queries, hidden].
Timestep conditioning of shape [batch, queries, hidden].
Cross-attention source of shape [batch, keys, hidden], or None for self attention.
Boolean tensor of shape [queries, keys], true where attention is allowed.
Rotary table of the queries, shape [batch, queries, head_dim // 2, 2].
Rotary table of the keys, shape [batch, keys, head_dim // 2, 2].
Returns: Tensor
Tensor of shape [batch, queries, hidden].
Bases: Module
Action token embedding with the flow time at the input: w3(silu(w2([w1(a); tau(t)]))).
Embed noised action tokens.
Parameters:
Tensor of shape [batch, action_tokens, action_patch_dim].
Flow time per token, shape [batch, action_tokens].
Returns: Tensor
Tensor of shape [batch, action_tokens, hidden].
Bases: Module
Scale-only adaptive RMS norm: (1 + proj(silu(cond))) * rms_norm(x).
Normalize and scale.
Parameters:
Tensor of shape [batch, queries, hidden].
Tensor of shape [batch, queries, hidden].
Returns: Tensor
Tensor of shape [batch, queries, hidden] in the dtype of tokens.
Bases: Module
[cos(t f), sin(t f)] features of the flow time followed by a two-layer MLP.
Embed timesteps.
Parameters:
Float tensor of shape […].
Returns: Tensor
Tensor of shape […, dim] in the MLP weight dtype.
Chunk index of every expert query in the [proprio | future | actions] layout.
Gated GELU: gelu_tanh(first half) * second half over the last axis.
Weightless RMS norm over the last axis; the mean and scale run in float32.
Parameters:
Tensor of shape […, hidden].
Returns: Tensor
Tensor of shape […, hidden] in the dtype of x.