# Constructive Two-View Gauge Initialization

- ID: 2048
- Canonical URL: https://synthcore.org/idea/2048/constructive-two-view-gauge-initialization
- API JSON: https://synthcore.org/api/idea/2048.json
- API Markdown: https://synthcore.org/api/idea/2048.md
- Verification status: beats_baseline
- Source: [arXiv:2608.09464](https://arxiv.org/abs/2608.09464)
- Category: training
- Solves: stability, speed, accuracy
- ML areas: optimizer, initialization, rnn, ssm, world-model
- Math tags: optimization, linear-algebra, geometry, control-theory, dynamical-systems
- Ratings: usefulness 7/10; difficulty 4/10; novelty 8/10

## Idea description

Initialize latent coordinate-frame parameters analytically from two temporally separated neural predictions instead of starting joint optimization from arbitrary translation and orientation. This removes the continuous gauge before backpropagation and should prevent EKF-like or gradient-based failures caused by large yaw and position initialization errors.

## Mathematical statement

Let d_q=q_2-q_1 and d_ell=ell_2^v-ell_1^v be the global and relay-frame displacement vectors at two views. In the noiseless planar case d_q=R(psi)d_ell, so the relative yaw is psi_hat=atan2(d_{q,y},d_{q,x})-atan2(d_{ell,y},d_{ell,x}) modulo 2pi, provided norm(d_ell)>0. Given this yaw, the relay translation is x_hat=q_1-R(psi_hat)ell_1^v. If the target vector is observed in the relay frame, the target estimate is p_hat=x_hat+R(psi_hat)ell_1^t; for noisy data, average these estimates over all views with robust weights. In a neural setting q_k and ell_k^v may be predicted by a pose encoder and sensor encoder, while ell_k^t is a learned target-bearing representation. The initialization is used only to choose the gauge; subsequent optimization can refine all quantities.

## Key formulas

- $$d_q=q_2-q_1,\qquad d_\ell=\ell_2^v-\ell_1^v,\qquad d_q=R(\psi)d_\ell,$$
- $$\hat\psi=\operatorname{atan2}(d_{q,y},d_{q,x})-\operatorname{atan2}(d_{\ell,y},d_{\ell,x})\pmod{2\pi},$$
- $$\hat x=q_1-R(\hat\psi)\ell_1^v,\qquad \hat p=\hat x+R(\hat\psi)\ell_1^t,$$
- $$\min_{x,p,\psi}\sum_{k=1}^{T}\rho\!\left(\|q_k-x-R(\psi)\ell_k^v\|_{\Sigma_v^{-1}}^2+\|p-x-R(\psi)\ell_k^t\|_{\Sigma_t^{-1}}^2\right),$$

## Implementation notes

1. Integration point: apply this as a warm-start layer before training a neural sensor-fusion model, recurrent filter, differentiable optimizer, or latent-variable encoder. Select two frames from each sequence with the largest predicted displacement norm, rather than using adjacent frames. 2. Pseudocode: encode q[1:T], ell_v[1:T], and ell_t[1:T]; choose (a,b)=argmax norm(q[b]-q[a]); compute dq=q[b]-q[a] and dl=ell_v[b]-ell_v[a]; reject the pair if norm(dl)<epsilon; calculate psi0 with the atan2 formula; calculate x0=q[a]-R(psi0)@ell_v[a]; calculate p0 as the robust weighted mean of x0+R(psi0)@ell_t[k]; initialize the calibration head with (p0,x0,psi0); then run 10-50 refinement steps using the joint residual objective. 3. The paper supplies the two-view identifiability construction and the failure condition d_l=0. Neural quantities, covariance weights, pair selection, and robust Huber or Tukey weighting are estimated empirically. 4. First cheap experiment: use a 2-D synthetic localization task with an MLP or GRU receiving noisy range-bearing-like vectors, initialize yaw errors uniformly over [-pi,pi] and translation errors up to 2 m, and compare random initialization, supervised frame initialization, and this two-view initializer. Measure iterations to reach a fixed residual and final target error. The prediction is that convergence failures will concentrate when the selected displacement norm is small or the window condition number exceeds about 100; on well-excited windows, initialization should converge from near-pi yaw errors and reduce optimization steps by at least a factor of two relative to random initialization.

## Verification

- Status: beats_baseline
- Mechanism evidence: yes
- Mechanism confirmed: yes
- Practical verdict: helps
- Verdict: Built a NumPy/SciPy constructive two-view gauge initializer and verified it numerically. Noiseless recovery was essentially exact, with position error 1.3e-15 and yaw error 4.4e-16. Under independent measurement noise, yaw RMSE followed the predicted inverse-displacement law with fitted log-log slope -1.007; near zero displacement, yaw became unidentifiable. The initializer also reduced median refinement evaluations from 9 to 5, although final residuals were unchanged.

### Mechanism check

- Verdict: Built a NumPy/SciPy constructive two-view gauge initializer and verified it numerically. Noiseless recovery was essentially exact, with position error 1.3e-15 and yaw error 4.4e-16. Under independent measurement noise, yaw RMSE followed the predicted inverse-displacement law with fitted log-log slope -1.007; near zero displacement, yaw became unidentifiable. The initializer also reduced median refinement evaluations from 9 to 5, although final residuals were unchanged.
- Confidence: 9/10
- Limitations: Tested only a tiny synthetic planar localization problem with equal weighting and SciPy refinement, not a neural encoder, recurrent filter, EKF, robust weighting, covariance weighting, or real sensor data. The singular sweep demonstrated loss of identifiability but did not estimate a formal condition-number threshold.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.0152
- Paired wins: 7/8
- Benchmark verdict: idea better (significant)

## Artifacts

- [bench_report.json](https://synthcore.org/code/824/bench_report.json)
- [report.md](https://synthcore.org/code/824/report.md)
- [report_bench_2026-09-01T112948.md](https://synthcore.org/code/824/report_bench_2026-09-01T112948.md)
- [results.json](https://synthcore.org/code/824/results.json)
- [two_view_bench.py](https://synthcore.org/code/824/two_view_bench.py)
- [two_view_experiment.py](https://synthcore.org/code/824/two_view_experiment.py)
- [two_view_registered_track.py](https://synthcore.org/code/824/two_view_registered_track.py)
- [two_view_registered_track_v2.py](https://synthcore.org/code/824/two_view_registered_track_v2.py)
- [Download all files as ZIP](https://synthcore.org/download/824)

## Disclaimer

AI-generated research hypothesis, automatically tested. Not peer-reviewed.
