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

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

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

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.

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

Descrizione

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.

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.