hmc requires max_iterations, which it never reads, and the docs' hmc example fails to load without it

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

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

Start in pybnf/config.py at Configuration._req_user_params() and trace how required parameters are selected for HMC; compare with the handling of unread beta mentioned in the issue. Read the HMC tests in tests/test_hmc.py and tests/test_wall_time_fit.py, plus the example in docs/analytical_objectives.rst. Done when the docs example loads without max_iterations, setting that key for HMC is rejected with guidance about num_warmup and num_samples, and the example has a loading test.

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

Descripción

bug documentation

Every fit must set max_iterations: Configuration._req_user_params() returns {'models', 'population_size', 'max_iterations'} (pybnf/config.py:795). hmc never reads it. Its run length is num_warmup and num_samples. So an hmc conf must carry a key that has no effect. The hmc example in docs/analytical_objectives.rst ("Sample a banana posterior with HMC", about line 272) leaves the key out, so it fails to load when copied as shown:

Error: The following configuration keys must be specified:
	max_iterations

The PEtab importer writes max_iterations = 100 into the hmc confs it generates for the same reason (#1074).

Found while reviewing #1066. Reproduced on main at cbb8159c.

Reproduction

Load the snippet from the docs as it stands:

edition     = 2
objective   = banana, a = 1, b = 8
job_type    = hmc
uniform_var = x1 -12 12
uniform_var = x2 -12 12
population_size = 4
num_warmup   = 1000
num_samples  = 2000
target_accept = 0.95
What should happen

Don't require max_iterations for hmc. Then, as #860 did for an unread beta, refuse it when it is set, with a message pointing to num_warmup and num_samples, so no one thinks it sets the run length. No shipped conf selects hmc; the tests (tests/test_hmc.py, tests/test_wall_time_fit.py) and the PEtab importer are what set it today. Add a test that loads the docs example as written.

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.