A mutant that scales a fixed model parameter (A0*3) fits on the bngsim backend, then fails while saving the best fit
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 56/100
Direzione di ricerca
Start with BNGLModel._get_mutant_model in pybnf/pset.py and compare how _nominal_param_value in pybnf/bngsim_model/expressions.py resolves the parameter used by the bngsim mutant builder. Trace how the model parameter definition is evaluated when it depends on other parameters, including free ones. Done means saving the best fit writes the same mutant parameter value used during fitting; the issue gives a reproduction with m1.bngl and tcko.exp.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What you do. Fit a BNGL model with bngl_backend = bngsim and a mutant (or condition) that changes a parameter the fit does not estimate by a relative amount. For example, mutant = m1 ko A0*3 : tcko.exp, where A0 is in the model's parameters block and has no uniform_var / loguniform_var line.
What you see. The fit runs to the end and reports its stop criterion. Then the run stops with:
Condition perturbs fixed parameter 'A0' with relative operator '*'; the BNGL-emit path cannot resolve its nominal. Use an absolute '=' value, or declare 'A0' as a free parameter.
Results/sorted_params_final.txt is written. The best-fit simulations, and everything the run does after them, are not. Reproduced with job_type = gntr and job_type = de.
What should happen. Either the best fit is saved, or the configuration is refused when it loads, before the fit runs. The fit itself simulates the mutant correctly, so saving it is the better outcome.
Where. Saving the best fit writes each mutant's BNGL text through BNGLModel._get_mutant_model (pybnf/pset.py, reached from _copy_best_fit_sims → save_all). That function refuses a relative operation on a parameter that is not in the fit vector, because it does not evaluate the model's own definition of the parameter. The bngsim simulation path (the mutant builder in pybnf/bngsim_model/expressions.py) takes that base from the engine model (_nominal_param_value), which is why the fit works.
A fix has to write the same value the fit simulated, including when the parameter's definition is an expression of other parameters, free ones among them. _get_mutant_model is also what BNG2.pl's execute uses for a mutant, so on bngl_backend = bionetgen the same refusal should come at the first simulation rather than after the fit (read from the code, not run).
Reproduction. m1.bngl:
begin model
begin parameters
A0 1.0
k_deg 0.5
end parameters
begin molecule types
A()
end molecule types
begin seed species
A() A0
end seed species
begin observables
Molecules A_tot A()
end observables
begin reaction rules
A() -> 0 k_deg
end reaction rules
end model
begin actions
generate_network({overwrite=>1})
simulate({method=>"ode",t_start=>0,t_end=>4,n_steps=>8,suffix=>"tc"})
end actions
tc.exp holds A_tot = exp(-0.7 t) and tcko.exp holds A_tot = 3 exp(-0.7 t), both at t = 0, 0.5, ..., 4. The job:
edition = 2
bngl_backend = bngsim
model = m1.bngl : tc.exp
mutant = m1 ko A0*3 : tcko.exp
objective = sos
uniform_var = k_deg 0.1 10
job_type = gntr
Found during review of the multiple-shooting batch (fix/ms-batch). It is outside that branch's scope: the branch does not touch this path, and the behaviour is the same on main.
- Lingua principale
- Python
- Stelle
- 26
- Fork
- 25
- Merge medio
- 4h 25m
- PR unite (30g)
- 9
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lanl/PyBNF
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
min_objective stops a sampler run early and reports "Fitting complete": samplers should refuse itApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
bug minor
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
-
bug minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Issue simili
-
docs(contributing): the two things that silently block a PRForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaavailable documentation good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 95/100
Nixitov/Riptide-Native#944 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
JTHCode/secretguard#24 ·
I maintainer di solito rispondono entro 1 giorno
-
area: middleware documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
omarelshamy25x/shamy-hijri#63 ·
I maintainer di solito rispondono entro 1 giorno