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

Abierto
#1,058 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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).

Lenguaje dominante
Python
Estrellas
26
Forks
25
Merge medio
4 h 25 min
PR fusionados (30 d)
9

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de lanl/PyBNF

Todos los issues de lanl/PyBNF

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.