vllm_omni.diffusion.models.gr00t.dataio.utils ¶
apply_sin_cos_encoding ¶
Apply sin/cos encoding to values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values | ndarray | Array of shape (..., D) containing values to encode | required |
Returns:
| Type | Description |
|---|---|
ndarray | Array of shape (..., 2*D) with [sin, cos] concatenated |
This DOUBLES the dimension. For example:
Input: [v₁, v₂, v₃] with shape (..., 3) Output: [sin(v₁), sin(v₂), sin(v₃), cos(v₁), cos(v₂), cos(v₃)] with shape (..., 6)
nested_dict_to_numpy ¶
normalize_values_meanstd ¶
Z-score normalize values using params['mean'] and params['std'].
Features whose std == 0 are passed through unchanged.
normalize_values_minmax ¶
Min-max normalize values to [-1, 1] using params['min'] and params['max'].
Accepts 2D (T, D) or 3D (B, T, D) arrays. Features with min == max are emitted as 0.
parse_modality_configs ¶
parse_modality_configs(
modality_configs: dict[str, dict[str, ModalityConfig]],
) -> dict[str, dict[str, ModalityConfig]]
to_json_serializable ¶
unnormalize_values_meanstd ¶
Inverse of :func:normalize_values_meanstd (x * std + mean).
Features whose std == 0 are passed through unchanged.