nemo_automodel.components.models.praxis.objective
nemo_automodel.components.models.praxis.objective
Flow-matching training objective of the Praxis policy.
A training window holds K clean chunk latents, the anchor latent, the text states, the
normalized action tokens and the boundary poses. One step noises the window and asks the
policy for the video and action velocities:
- Video: the whole window first gets one timestep
t0and one noiseeps0; the target iseps0 - x0. Then every chunkkis re-noised with its own timestept_kfrom the bf16-roundedx_t, so that the K noised chunks share one velocity target. The clean copies of chunks0 .. K-2are the recovered clean latents. Timesteps follow the shifted lawt = s u / (1 + (s - 1) u). - Actions: every chunk gets an independent uniform timestep; the target is
eps - x0. - Text dropout swaps the text for the encoded blank caption (the unconditional branch of text guidance); proprio dropout zeroes the boundary poses.
- Training also moves the rotary positions of the anchor, the text and the video by random offsets inside one frame block so the model does not memorize absolute positions.
The loss is video_weight * mse(video) + action_weight * mse(action); a window whose action
loss is not finite or above action_guard contributes an action loss of exactly zero.
Module Contents
Classes
Functions
API
The random values of one window, drawn before the forward pass.
Action noise of shape [1, K * F, action_patch_dim] (float32).
Uniform values of shape [K] for the action timesteps.
Uniform value of shape [1] for the proprio dropout.
(encoder anchor, encoder text, encoder video, decoder video) offsets.
Uniform value of shape [1] for the text dropout.
Window noise of shape [1, channels, K * F, h, w] (bf16).
Uniform values of shape [K] for the per-chunk timesteps.
Uniform value of shape [1] for the window timestep.
One encoded training window (batch size 1).
Normalized action tokens of shape [1, K * F, action_patch_dim] (float32), chunk-major.
Anchor latent of shape [1, channels, 1, h, w].
K clean chunk latents, each of shape [1, channels, F, h, w].
Normalized boundary poses of shape [1, K, proprio_patch_dim] (float32).
Text-encoder states of shape [1, text_tokens, text_dim] (bf16).
Loss and detached metrics of one window.
1.0 when the guard zeroed the action loss, else 0.0.
Scalar float32 loss with gradients.
Detached action loss before the guard.
Detached video loss.
Weights, timestep law and dropout rates of the objective.
Bases: Module
The training objective around a PraxisPolicy.
Noise the actions on the CPU in float32.
Returns: tuple[Tensor, Tensor, Tensor, Tensor]
(noised [1, K*F, A], timesteps [1, K], target [1, K*F, A], proprio [1, K, P]).
Draw the random values of batch from a CPU generator in a fixed order.
Draw the random values and return the loss of batch.
Loss of one window for the given random values (no dropout, no rotary offset in eval mode).
Noise the window.
Returns: Tensor
(noised [1, C, K*F, h, w], clean [1, C, (K-1)*F, h, w] or None, timesteps [1, K], target [1, C, K*F, h, w])
shift * u / (1 + (shift - 1) * u) elementwise.