ACT Temporal Action Ensembling and Style Regularization
ACT · RSS 2023 · Medium · 30 minutes
Ensemble overlapping predictions for the current action and compute the CVAE standard-normal KL.
Implement two ACT tensor cores with predictions already aligned to one execution time; omit the visual Transformer, action-chunk network and teleoperation system.
Functions to implement
temporal_ensemble(actions: Tensor, valid: Tensor, decay: float) -> Tensorstyle_kl(mu: Tensor, logvar: Tensor) -> Tensor
ACT Temporal Action Ensembling and Style Regularization
1. Exercise goal
Ensemble overlapping predictions for the current action and compute the CVAE standard-normal KL.
Implement two ACT tensor cores with predictions already aligned to one execution time; omit the visual Transformer, action-chunk network and teleoperation system.
2. Core equations
$$ \bar a=\frac{\sum_{i=0}^{K-1}e^{-ki}a_i}{\sum_i e^{-ki}},\quad L_{KL}=\frac1{2B}\sum_{b,d}(\mu_{bd}^2+e^{\ell_{bd}}-1-\ell_{bd}). $$
3. From equations to code
temporal_ensemble(actions: Tensor, valid: Tensor, decay: float) -> Tensorstyle_kl(mu: Tensor, logvar: Tensor) -> Tensor
The official implementation applies a negative exponential to oldest-to-newest indices, favoring older predictions for positive decay. Explicit validity replaces its all-zero sentinel so zero actions remain valid. Logvar means log variance.
4. Contract and boundaries
Actions are (K,D), valid is bool (K,) with at least one true. Valid predictions are oldest-to-newest; remove padding then assign ranks 0..Kvalid-1, decay>=0. Mu/logvar are (B,Z); KL sums latent coordinates and averages examples. Preserve floating-input gradients.
Validation helpers are provided. All floating inputs are finite CPU float32/float64; do not mutate inputs. Invalid shape, dtype, range or mask arguments raise ValueError.
5. Deterministic experiment and visualization
Construct five alternating-error predictions of 64 sinusoidal targets and compare ensemble MSE with the latest prediction; also optimize a style mean toward zero using the submitted KL.
The visualization is generated by viz/gen.py; T3 runs the same experiment with your functions and records its actual metrics. These are small deterministic teaching results, not a robot benchmark.
6. Run your implementation
Complete the functions in the Python editor on the right, then click Run tests. Inspect each failed check, update your implementation, and run again. Passing every required check marks the problem as solved and unlocks the notes.
7. Sources and extensions
- Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware — Temporal ensembling at inference; official imitate_episodes.py exp_weights and CVAE policy KL
- Verified source
- Verified source
Verified 2026-10-28. Extending this operator to the full paper requires the omitted model, data and environment described in the scope above.