Skip to content

Lineardiff - #224

Merged
pavelkomarov merged 13 commits into
masterfrom
lineardiff
Aug 29, 2026
Merged

Lineardiff#224
pavelkomarov merged 13 commits into
masterfrom
lineardiff

Conversation

@pavelkomarov

Copy link
Copy Markdown
Collaborator

Four main goals:

  1. make it not brittle
  2. make it not painful to optimize
  3. make it pass the new scale invariance test
  4. make it multidimensional

pavelkomarov and others added 6 commits August 27, 2026 19:12
The only conflict was in the error bounds table, where the two sides changed adjacent lines for unrelated reasons, so each side's own edit survives: master's updated `robust_irreg_step` rows come from the robustdiff normalization in 4ad25ee, which the branch never touched, while the loosened L-infinity bound on `lineardiff`'s first row is this branch's own change from 1513daf.

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

pavelkomarov commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator Author

I just ran the new thing in notebook 4, and the results are totally on par with any other method, so I think in spirit this one is done. Claude knocked it out of the park. I really should get in and touch and clean and fully 100% mathematically understand the files myself, but I think like waveletdiff that can kind of wait indefinitely. I'm riding along on this one, mostly coaching, probing for objective correctness of outputs and verisimilitude of deeper reasoning and math as we go.

…ultidim test

polydiff and lineardiff both documented window_size=None as "no sliding, fit globally" but rejected it in their required-argument checks, leaving the branch reachable only through the deprecated options={'sliding': False} route; dropping window_size from those checks makes the docstrings true and the two methods agree. That path has a longer history than it looks: the original dispatch stripped window_size off params only inside the sliding branch, so lineardiff's global fit raised ValueError from the first commit until the move to keyword arguments incidentally fixed it. Separately, lineardiff's multidimensionality test was fitting a noise-free surface at gamma=0.01, a heavy sparsity prior with no noise to trade fidelity against; gamma=1e-6 is three decades more accurate at the same runtime, so its bounds tighten from (2,1),(3,2) to (0,-1),(1,-1). Also corrects lineardiff's docstring, which described a polynomial fit and called order a polynomial degree rather than a count of states, allocates the output arrays as float so integer input cannot truncate through empty_like, and adds lineardiff to notebook 6 now that it takes an axis argument.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@pavelkomarov
pavelkomarov merged commit 6d70830 into master Aug 29, 2026
1 check passed
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.

Improve lineardiff: strong accuracy, but costly to optimize and several rough edges

1 participant