Gradient fits on small-magnitude data return their start point as converged: the first-order stopping test is absolute, so it passes where the objective itself is tiny

Aperta
#1,058 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start with the implementations of the gntr, trf, and lbfgs stopping criteria and the multiple-shooting tolerances ms_final_grad_tol and ms_optimality_tol. Reproduce the small-magnitude example, including A0 = 3e-5, and inspect the reported objective, gradient tolerance, and start-point parameters. Done means the affected fits no longer report convergence merely because an absolute gradient test passes, with regression coverage for small data and the existing larger-data behavior preserved.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What you see. A gradient fit (job_type = gntr, trf or lbfgs) on data whose values are small, such as molar concentrations, can return its start point unchanged and report "Stop criterion satisfied" and "Fitting complete". The data say otherwise, and nothing in the output says the fit never moved.

Example. The model is A() -> B() at k1 and B() -> 0 at k2, with A0 = 3e-5. It is fitted to exact Btot data at t = 1..10, generated at k1 = 0.5 and k2 = 0.2, so the optimum is objective 0 there. The config uses objective = sos, loguniform_var k1 and k2 in [0.01, 10], and population_size = 1, so the fit starts at the box centre, k1 = k2 = 0.316.

job_type reported best k1 k2
gntr 8.217e-11 0.316228 (start) 0.316228 (start)
trf 8.217e-11 0.316228 (start) 0.316228 (start)
lbfgs 8.217e-11 0.316228 (start) 0.316228 (start)

Each run prints Stop criterion satisfied with objective function value of 8.217227743771922e-11.

Why. The first-order stopping tests (gntr_grad_tol, trf_grad_tol and their peers, default 1e-8) are absolute. With data of order 1e-5 the objective is of order 1e-10, and so is its gradient at a point far from the optimum. The test passes at the start, and the runner returns it as "gradient already flat at the start point". The same gntr job with A0 = 0.003 (data 100 times larger) moves from the same start to k1 = 0.49976, k2 = 0.20005 (objective 4.7e-13). The same holds for multiple shooting (ms_final_grad_tol, and ms_optimality_tol on its segmented rungs; see #914).

Possible fixes. Make the gradient test relative to the objective's own scale, or to its value at the start. Or refuse to call an unmoved start converged when the objective there is far from what the data allow. At the least, say in the result that the fit stopped at its start point.

Found during independent review of the multiple-shooting batch (#911–#915, #959, #1038, #1049).

Lingua principale
Python
Stelle
26
Fork
25
Merge medio
4h 25m
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lanl/PyBNF

Tutte le issue di lanl/PyBNF

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.