nemo_automodel.components.flow_matching.time_shift_utils
nemo_automodel.components.flow_matching.time_shift_utils
Module Contents
Functions
API
Sample timesteps from different distributions for better training coverage.
Parameters:
“uniform”, “logit_normal”, or “mode”
number of samples to generate
mean for logit-normal distribution
std for logit-normal distribution
scale for mode-based sampling
Returns:
Tensor of shape (batch_size,) with values in [0, 1]
Compute loss weights for flow matching based on sigma values.
Higher sigma (more noise) typically gets higher weight.
Parameters:
sigma values in range [0, 1]
weight scaling factor
Returns:
Loss weights with same shape as sigma
Convert timesteps to sigmas with sequence-length-aware shifting.
Parameters:
timesteps in range [0, 1]
number of tokens (frames * height * width / patch_size^2)
“linear”, “sqrt”, or “constant”
base shift for linear mode
max shift for linear mode
shift value for constant mode (default 3.0 matches Pika)
Returns:
sigma values for noise scheduling