min_objective stops a sampler run early and reports "Fitting complete": samplers should refuse it

Abierto Apto para principiantes
#1,072 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
testing

Línea de trabajo

Empieza por rastrear cómo se analiza y valida min_objective para los tipos de sampler indicados. Luego revisa la documentación de la clave y las pruebas de configuración existentes. Añade pruebas que verifiquen que cada sampler rechaza el ajuste al iniciarse con una explicación de que solo se aplica a los optimizadores; el trabajo estará terminado cuando la prueba de rechazo pase y la documentación indique que min_objective se aplica a los optimizadores.

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

Descripción

bug

min_objective is an optimizer's stop: "Stop fitting if an objective function lower than this value is reached." Samplers honour it too. A sampler run stops at the first proposal that scores below it, prints "Minimum objective value achieved" and "Fitting complete", and exits 0. It has run a small fraction of the requested iterations, and has a correspondingly small samples.txt.

A low objective on a sampler is just a draw near the mode, not a goal reached. And because when the run stops depends on the chain's own path, the draws it kept are not a fixed-length sample of the posterior. The run also writes no final credible intervals or histograms, the same end state as a wall_time_fit stop (#1068).

Found while reviewing #1066. Reproduced on main at cbb8159c. Since #921, a min_objective stop before the first draw is an error, whose hint says this key stops a sampler. A stop after the first draw is still reported as success.

Reproduction
edition = 2
objective = gaussian, mean = 0 0, variance = 1 1
uniform_var = g1 -10 10
uniform_var = g2 -10 10
random_seed = 1
output_dir = out
job_type = dream
population_size = 4
max_iterations = 20000
burn_in = 10
min_objective = 0.002

pybnf -c x.conf -o:

  • It prints "Completed iteration 610 of 20000", "Minimum objective value achieved" and "Fitting complete", and exits 0.
  • samples.txt has 24 draws, against about 800 for the full run at the default sample_every = 100.
  • Results/ has no credible* files.
What should happen

Refuse min_objective for every sampler (am, dream, p_dream, mh, pt, hmc) at start, naming the key and saying it applies to optimizers. Add a test for the refusal. Update the key's documentation to say so.

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.