feat(cadecon): kernel-RMSE convergence metric + reworked asymptote dashboard#170
Open
daharoni wants to merge 1 commit into
Open
feat(cadecon): kernel-RMSE convergence metric + reworked asymptote dashboard#170daharoni wants to merge 1 commit into
daharoni wants to merge 1 commit into
Conversation
…shboard Replace the convergence stopping criterion — previously the max relative change of the kernel's (t_peak, FWHM) — with the peak-normalized RMSE between successive iterations' bi-exponential kernels. The relative shape delta over-penalized t_peak jitter on the poorly-constrained rising edge, delaying convergence over changes that barely alter the kernel; a whole-waveform RMSE weights each parameter's change by how much it actually moves the kernel. Metric details: - Compute on the analytic parametric kernel (peak=1 by construction; no extra renormalization), not the un-normalized free-form h_free. - Sample both kernels on a shared native-fs grid over [0, 5*max(tau_decay)] so neither decay tail is truncated; floor to 24 samples for low-fs/fast kernels. - convergenceTol default 0.02 -> 0.005 (now a fraction of peak, ~2% tau change). - Kernel RMSE remains the sole convergence gate; the final kernel is still the median shape of the trailing window. Activity-stability metric now uses a symmetric max(||s_new||,||s_old||) denominator so a collapsing cell can't blow up the ratio. Asymptote dashboard reworked into two rows: the two convergence signals (kernel RMSE, activity change) on a shared log-y axis that decays toward 0, with a reactive tolerance band on the kernel panel; R²/PVE stay linear plateau panels. The activity panel marks both the gate iteration and the one-iteration-later point where activity settles (structural lag: spikes are inferred from the prior iteration's kernel). The metric lives in @calab/compute (kernel-math.ts) sharing a sampleBiexp core with computeKernel, with direct unit tests. Chart marker drawing shares a drawVerticalMarker primitive; the two trend panels share a TrendChart shell. Docs and tutorials updated to describe the RMSE criterion. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Replaces CaDecon's iterative convergence stopping criterion with a peak-normalized RMSE between successive iterations' kernels, and reworks the Asymptote dashboard so the two signals we actually watch for convergence read as a matched pair.
Previously convergence was gated on the max relative change of the kernel's
(t_peak, FWHM). That over-penalizedt_peakjitter on the poorly-constrained rising edge — a few-ms wobble read as ~8% relative change and reset the patience streak, delaying convergence over a change that barely altered the kernel. A whole-waveform RMSE weights each parameter's change by how much it actually moves the kernel (that same wobble now reads ~1%).Metric
h_free.[0, 5·max(τ_decay)](themaxnever truncates a genuine tail difference), floored to 24 samples so a low-fs / fast kernel doesn't collapse to a handful of points.convergenceToldefault 0.02 → 0.005 (now a fraction of peak, ≈ a 2% τ change). Kernel RMSE remains the sole gate; the final kernel is still the median shape of the trailing window.max(‖s_new‖, ‖s_old‖)denominator so a collapsing cell can't blow up the ratio.Dashboard
Asymptote tab reworked into two rows:
Code quality
@calab/compute(kernel-math.ts), sharing asampleBiexpcore withcomputeKernel, with direct unit tests.drawVerticalMarkerprimitive; the two trend panels share aTrendChartshell.Testing
kernelShapeRmsecases), cadecon 33, catune 26.🤖 Generated with Claude Code