Skip to content

feat(flow): flow-matching stages for the HPT head - #44

Open
AnikethCheluva wants to merge 1 commit into
graph-hpt-stemsfrom
graph-hpt-flow
Open

feat(flow): flow-matching stages for the HPT head#44
AnikethCheluva wants to merge 1 commit into
graph-hpt-stemsfrom
graph-hpt-flow

Conversation

@AnikethCheluva

Copy link
Copy Markdown

Adds the objective HPT is trained with upstream, decomposed the same way the
diffusion head already is: noising, denoiser, loss. Both trios read "condition"
and "target" and write "loss/*" in training and "pred_action" at inference, so
choosing between them is a config edit rather than a code change.

Flow matching interpolates linearly between action and noise,

x_t = t * noise + (1 - t) * action

and predicts that path's constant velocity, noise - action. Sampling integrates
the field backwards from t=1 to t=0 with plain Euler steps, so unlike the
diffusion stages there is no noise schedule and no scheduler-signature
handshake to keep in sync.

time_dist defaults to beta(1.5, 1) as upstream: it leans toward the noisy end,
spending capacity where sampling starts and errors compound. Sampled time is
kept strictly inside (0, 1) because either endpoint degenerates -- at 0 the
path carries no noise, at 1 no action.

Tests pin the interpolation identity itself rather than just shapes (action is
recovered from x_t and u_t), that beta really does skew above uniform, the
per-mode contracts, that inference runs with the noising stage absent, and a
convergence check that the whole graph fits a fixed target and samples nearer
to it than noise -- which would fail if the interpolation, the velocity target
or the loss were wrong.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

Adds the objective HPT is trained with upstream, decomposed the same way the
diffusion head already is: noising, denoiser, loss. Both trios read "condition"
and "target" and write "loss/*" in training and "pred_action" at inference, so
choosing between them is a config edit rather than a code change.

Flow matching interpolates linearly between action and noise,

    x_t = t * noise + (1 - t) * action

and predicts that path's constant velocity, noise - action. Sampling integrates
the field backwards from t=1 to t=0 with plain Euler steps, so unlike the
diffusion stages there is no noise schedule and no scheduler-signature
handshake to keep in sync.

time_dist defaults to beta(1.5, 1) as upstream: it leans toward the noisy end,
spending capacity where sampling starts and errors compound. Sampled time is
kept strictly inside (0, 1) because either endpoint degenerates -- at 0 the
path carries no noise, at 1 no action.

Tests pin the interpolation identity itself rather than just shapes (action is
recovered from x_t and u_t), that beta really does skew above uniform, the
per-mode contracts, that inference runs with the noising stage absent, and a
convergence check that the whole graph fits a fixed target and samples nearer
to it than noise -- which would fail if the interpolation, the velocity target
or the loss were wrong.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant