specsrbench.figures.fig1_toy_methods¶
Figure 1 – the eight methods on a 1D toy, where the truth is known exactly.
A close doublet the LSF blends into one blob, plus a weak isolated line, at sigma_LSF = 8 px and a peak S/N of ~12. Every method in the paper is run on it, scored against the truth it was generated from, and drawn.
The toy exists because on real spectra there is no ground truth: the grating reference is itself noisy and band-limited, so “recovered the line” and “invented a line that happens to sit there” are hard to separate. Here they are not. The three numbers under each panel – peak amplitude, the dip between the blended pair, and fitted FWHM – are the same quantities Figure 5 measures on real data, against a truth that is known rather than estimated.
The parameter values in the panel titles are the classical literature defaults at this scale, not the tuned values the benchmark uses. Every classical parameter in this project is grid-dependent, and the settings tuned for the R = 4000 log grid are meaningless at 512 pixels. A toy this size is also far easier to deconvolve than a real spectrum: read the panels as an illustration of what each method does, never as a performance claim.
Reproducibility¶
Seven of the eight panels are deterministic. The eighth trains a small 1D CNN
inline, and cuDNN’s convolutions reduce in a non-deterministic order on GPU, so
its row moves in the third or fourth decimal between runs (RMSE 0.0143 vs
0.0144 when this was checked). The conclusion does not move – the CNN wins on
every metric by a wide margin – but this is the one figure in the paper that
is not bit-reproducible. Pass deterministic=True to trade a little speed
for a fixed result.
Module Attributes
|
|
|
Training of the toy CNN. |
Functions
|
Draw figure 1. |
|
FWHM by counting samples above half maximum, around a known position. |
|
|
|
Place each known template, fit amplitudes by inner-product projection. |
|
Multiplicative, non-negative. |
|
FISTA with a wavelet-domain L1 prior: min_x ||h*x - y||^2 + lam ||Wx||_1. |
|
Wiener with a first-derivative penalty in place of a flat noise floor. |
|
min_x ||Hx - y||^2 + lam TV(x), by ISTA with a Chambolle prox. |
|
|
|
|
|
Depth of the valley between the blended pair, 0 = merged, 1 = resolved. |
|
A small SR1-shaped 1D ResNet, trained on fresh draws from the generator. |