A noise formula that uses a fixed model parameter (PEtab noiseFormula `0.5 * v3`) passes every load check, then fails each parameter set as it is scored, so the fit either stops with "Your simulations are failing to run" or finishes with an objective of inf

Aperta
#961 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Trace the importer and scoring paths in pybnf/petab/import_.py:954-956, pybnf/config.py:2560 and 2616, pybnf/noise/source.py:616-626, and pybnf/algorithms/core.py:407-414. Reproduce the supplied PEtab example, then determine whether model parameters in noise formulas should be resolved like measurement formulas or rejected during loading. Done means the example reports the real configuration error or computes the expected objective, rather than recording every evaluation as a failed simulation with inf.

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

Descrizione

bug silent-incorrectness

A PEtab problem whose noiseFormula uses a model parameter that is not estimated, such as 0.5 * v3 with v3 = 3 in the model, imports as noise_model y = gaussian, sigma = prediction_formula 0.5 * v3 and passes every check when the job loads. Every parameter set then fails as it is scored, because PyBNF looks for v3 among the simulated columns. PyBNF counts each of these as a failed simulation, and the real cause goes only to the log file. With the importer's default settings, the fit stops after 100 of them with "Your simulations are failing to run. Logs from failed simulations are saved in the FailedSimLogs directory", although no simulation failed and FailedSimLogs is empty. A run with fewer than 100 evaluations prints only "Fitting complete", exits 0, and reports a random draw as the best fit, with an objective of inf for every parameter set. The correct noise SD is 0.5 × 3 = 1.5, which gives an objective of 0.1667 at the problem's start point.

Example

Model m.bngl: y()=v1*(x^2)+(v2*x)+v3 over a counter x that grows at rate 1 from 0, with v1 0.5, v2 1, v3 3.

PEtab tables (libpetab v2 lint: no issues):

parameters.tsv    parameterId  lowerBound  upperBound  nominalValue  estimate
                  v1           0           10          0.5           true
                  v2           0           10          1             true
observables.tsv   observableId  observableFormula  noiseFormula  noiseDistribution
                  obs_y         y                  0.5 * v3      normal
measurements.tsv  obs_y  e1  time 0, 1, 2  measurement 3.5, 4, 7.5
experiments.tsv   e1  0  (no condition)
from pybnf.petab import import_job
import_job('problem.yaml', 'imp')          # writes imp/imported.conf

Then pybnf -c imported.conf, run in imp/:

  • With the importer's default settings (population_size = 50): Error: Your simulations are failing to run. Logs from failed simulations are saved in the FailedSimLogs directory. FailedSimLogs is empty.
  • With population_size = 3, max_iterations = 1: the console shows Fitting complete, the exit code is 0, and sorted_params_final.txt lists three parameter sets, each with Obj inf. The first one listed is a random draw (v1 = 4.70, v2 = 7.37).
  • The log file has one line per evaluation: A prediction-dependent noise formula for 'y' references 'v3', which is neither a declared free parameter nor a simulated output column.

Correct value: the same job with sigma = fix_at 1.5 scores the start point (0.5, 1) at 0.16667, and numpy gives Σ(y − d)²/(2·1.5²) = 0.75/4.5 = 0.16667.

The same thing happens to other errors in the conf that PyBNF finds only while scoring. For example, a constraint file that uses par.x.par (constraint.py:469) gives "Your simulations are failing to run" with an empty FailedSimLogs, or "Fitting complete" with inf in a short run.

Why

At load, the prediction_formula is checked against the model's names, which include its parameters, so v3 passes (pybnf/config.py:2616). When each parameter set is scored, the noise source looks up every name that is not a free parameter as a simulated column and raises when it is not there (pybnf/noise/source.py:616-626). Measurement formulas (observable: ..., formula:) avoid this by reading model parameters from a constants table (config.py:2560); the noise formula has no such table. The scoring step catches every exception and records it as a failed simulation (pybnf/algorithms/core.py:407-414, from #388). The importer chooses prediction_formula because v3 is a model name (pybnf/petab/import_.py:954-956).

Possible fix

Give the noise formula the same treatment of model parameters as measurement formulas, or refuse at load and name the parameter. Separately, an error in the conf that is raised while scoring should end the run with its own message, not be counted as a failed simulation.

Related: #817 (the same scoring-step catch), #836 (measurement formulas that read a parameter changed by a condition).

Found while fixing the PEtab issues #892–#908 (2026-09-25); reproduced on main at cd2be675.

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

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.