nemo_automodel.components.models.praxis.backbone
nemo_automodel.components.models.praxis.backbone
Two-tower video backbone of the chunk-causal window.
The encoder tower reads [registers | anchor | text | noised chunks | clean chunks] and
returns the conditioning of the noised tokens plus the tap features for the action
expert. The decoder tower reads [registers | noised chunks] at the unpatched latent
resolution, modulated per token by the encoder output, and returns the video velocity.
Rotary positions: each latent frame owns a block of FRAME_STRIDE positions; inside a
frame a token sits at 1 + row * ROW_STRIDE + column. Registers are at position 0. In
the encoder the anchor takes frame block 0, the text frame block 1 and the noised frames
start at frame block 2; a clean frame shares the positions of its noised twin.
Module Contents
Classes
Functions
Data
API
velocity of shape [batch, channels, frames, height, width] (None without decoding) and the encoder features.
Bases: Module
Zero-centred RMSNorm followed by a linear map to latent channels.
Project decoder tokens.
Parameters:
Tensor of shape [batch, tokens, hidden].
Returns: Tensor
Tensor of shape [batch, tokens, c_out].
Bases: Module
The decoder tower (see the module docstring).
Predict the velocity of the noised chunks.
Parameters:
Noised latents of shape [batch, channels, K * F, h, w].
Encoder conditioning of shape [batch, K * F, h, w, hidden].
Flow time of each chunk, shape [batch, K].
Rotary offset of the video positions in training.
Returns: Tensor
Velocity of shape [batch, channels, K * F, h, w].
Encoder outputs that the action expert reads.
(start, length) of the clean chunk tokens, None for one chunk.
The encoder input sequence (block 0 input) of shape [batch, tokens, hidden].
Latent frames per chunk.
(start, length) of the register, anchor and text runs.
Chunks in the window.
(start, length) of the noised chunk tokens.
Rotary positions of the sequence, shape [batch, tokens].
Block outputs at the tap blocks, each of shape [batch, tokens, hidden].
Tokens per latent frame.
Bases: Module
The encoder tower (see the module docstring).
[batch, channels, frames, h, w] latents to [batch, frames * h * w, hidden] tokens.
Encode a window of K chunks.
Parameters:
Text-encoder states of shape [batch, text_tokens, text_dim].
Anchor latent of shape [batch, channels, 1, h, w].
Clean copies of chunks 0 .. K-2 of shape [batch, channels, (K-1) * F, h, w], or None for K == 1.
Noised chunks of shape [batch, channels, K * F, h, w].
Flow time of each noised chunk, shape [batch, K].
(anchor, text, video) rotary offsets of training.
Returns: Tensor
The conditioning of the noised tokens, shape [batch, K * F, h, w, hidden], and the
Bases: Module
Fixed random Fourier features of the flow time: 0.5 * cos(2 pi (t f + phi)).
Embed timesteps.
Parameters:
Tensor of shape […, 1] or […]; the last axis is broadcast against the features.
Returns: Tensor
Tensor of shape […, dim] in the dtype of t.
Load-balancing terms of the routers during training (both zero at inference).
Weight of the sequence-wise balance loss of each router
(experts * sum_i f_i p_i), injected through the routing weights.
Step of the per-expert selection bias toward balanced load,
applied by PraxisPolicy.update_moe_gate_bias after each optimizer step.
Bases: Module
MLP from text-encoder states to trunk tokens, ending in a zero-centred RMSNorm.
Project text states.
Parameters:
Tensor of shape [batch, text_tokens, c_in].
Returns: Tensor
Tensor of shape [batch, text_tokens, hidden].
Bases: Module
Encoder tower and decoder tower of one denoising step.
Run one denoising step of a window.
Parameters:
Text-encoder states of shape [batch, text_tokens, text_dim].
Anchor latent of shape [batch, channels, 1, h, w].
Clean copies of shape [batch, channels, (K-1) * F, h, w], or None.
Noised chunks of shape [batch, channels, K * F, h, w].
Flow time of each chunk, shape [batch, K].
Run the decoder tower; otherwise velocity is None.
(encoder anchor, encoder text, encoder video, decoder video) offsets.
Returns: BackboneOutput
class:BackboneOutput with the velocity of shape [batch, channels, K * F, h, w].
Repeat row k of rows ([batch, chunks, hidden]) over chunk_tokens[k] tokens.
Rotary positions of the encoder sequence [registers | anchor | text | noised | clean].
Parameters:
Register tokens (position 0).
Latent grid of the anchor frame.
Text tokens.
Frames and latent grid of the noised chunks.
Frames of the clean copies.
Random (anchor, text, video) offsets of training; zeros at inference.
Returns: Tensor
Int64 tensor of shape [tokens].
Inverse of unpatch: fold (ph, pw) spatial patches into the channels.
Returns: Tensor
Tensor of shape [batch, channels * ph * pw, frames, h // ph, w // pw].
Move the channel patch of [batch, channels * ph * pw, frames, h, w] into space.
Returns: Tensor
Tensor of shape [batch, channels, frames, h * ph, w * pw].
Rotary positions of a video run in frame-major order.
Returns: Tensor
Int64 tensor of shape [frames * height * width].