Add optional sinusoidal history position encoding - #18
Merged
Conversation
KunYing-Lee
force-pushed
the
agent/history-sinusoidal-position-encoding
branch
3 times, most recently
from
August 10, 2026 18:04
6333f31 to
9731633
Compare
KunYing-Lee
force-pushed
the
agent/history-sinusoidal-position-encoding
branch
from
August 10, 2026 18:06
9731633 to
70e1d00
Compare
KunYing-Lee
marked this pull request as ready for review
August 10, 2026 18:07
There was a problem hiding this comment.
Pull request overview
Adds an optional fixed sinusoidal positional encoding for history tokens in the motion generation model, propagates it through experiment presets, and records it in the checkpoint architecture contract while maintaining legacy contract compatibility.
Changes:
- Introduce
SinusoidalPositionEncodingand an optionalhistory_pos_encodingpath inMotionGeneratorhistory conditioning. - Bump checkpoint architecture contract to v2, adding
history_pos_encodingrecording + validation while continuing to accept v1. - Align all
configs/generation/exp/*presets to the shared omnimodal + 4-GPU training protocol and update tests/docs accordingly (including removing100m_omnimodal).
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/generation/test_train_config.py | Adds regression test asserting all exp presets share the same omnimodal + sinusoidal protocol settings. |
| tests/generation/test_hydra_compose.py | Updates Hydra compose coverage to use exp=100m instead of removed 100m_omnimodal. |
| tests/generation/test_guided_conditions.py | Adds unit tests for sinusoidal history encoding behavior and validation. |
| tests/generation/test_checkpoint_architecture.py | Adds tests for recording/validating history_pos_encoding and v1/v2 compatibility behavior. |
| src/omg/generation/models/motion_generator.py | Adds history_pos_encoding option and applies sinusoidal encoding to history tokens when enabled. |
| src/omg/generation/conditions/position.py | Introduces fixed sinusoidal position encoding module. |
| src/omg/generation/architecture.py | Bumps architecture contract to v2, supports v1/v2, and validates history_pos_encoding. |
| README.md | Updates CLI example to use --exp 100m. |
| docs/generation.md | Updates export example to use --exp 100m. |
| configs/generation/model/motion_generator.yaml | Adds history_pos_encoding: none to global model config for explicit default behavior. |
| configs/generation/exp/base.yaml | Switches base preset to the shared validated protocol (incl. history_pos_encoding: sinusoidal). |
| configs/generation/exp/50m.yaml | Aligns 50m preset with shared protocol and enables sinusoidal history encoding. |
| configs/generation/exp/100m.yaml | Aligns 100m preset with shared protocol and enables sinusoidal history encoding. |
| configs/generation/exp/300m.yaml | Aligns 300m preset with shared protocol and enables sinusoidal history encoding. |
| configs/generation/exp/500m.yaml | Aligns 500m preset with shared protocol and enables sinusoidal history encoding. |
| configs/generation/exp/1b.yaml | Aligns 1b preset with shared protocol and enables sinusoidal history encoding. |
| configs/generation/exp/100m_omnimodal.yaml | Removes redundant preset in favor of the updated 100m preset. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
44
to
48
| text_mask_prob: float = 0.1, | ||
| history_mask_prob: float = 0.1, | ||
| history_pos_encoding: str = "none", | ||
| use_audio: bool = False, | ||
| audio_dim: int = 35, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
exp/*preset while keeping the global model default asnonefor backward compatibility100m_omnimodalpreset;100mnow provides the same omnimodal protocolThis PR makes no performance claim; it makes the validated architecture and training protocol explicit and reproducible.
Validation
git diff --checkpassed