You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 98ac37c
Browse filesBrowse the repository at this point in the historyBrowse files
fix: stop fine-tuning returning a model worse than its starting point
Three defects compounded, each hiding the next.
train() started with best_val_loss at infinity, so the first epoch always became
the best however bad it was, and the state training began from was discarded. It
now scores that starting point first, which means a fit can never be returned
that is worse than what it started with.
The output layer's scale was learned rather than solved. Both adaptation paths
end in a layer linear in its input, so for given earlier layers the best values
follow in closed form; they are now solved on the reference data before training.
The adapter's ReLU stack is largely dead at PyTorch's default initialisation:
before training its output was 0.0 to 0.1 for every peptide. That leaves the
activations reaching the output layer rank deficient, and torch.linalg.lstsq on
CUDA requires full rank, so the solve above returned non-finite values and
declined by design without saying so. It now uses a ridge-regularised normal
equation on the CPU, which tolerates rank deficiency.
Measured on the held-out setup that failed worst, a 133-minute gradient with 230
reference peptides. The adapter path went from 92.1 minutes to 1.63 and the
low-rank head from 11.4 to 2.05, against 1.47 and 1.28 for calibration. Before
the fix the adapter predicted a 26-minute range for a 133-minute gradient while
keeping a correlation above 0.9, because the peptide ordering was never what
broke.
Also reports, at error level, a fit whose validation error is a large fraction of
the reference retention-time span. A collapsed fit leaves both the loss curve and
the correlation looking unremarkable, so nothing else flags it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments