@@ -36,7 +36,8 @@ The example process based model (PBM) predicts a double-monod constrained rate
3636for different substrate concentrations, ` S1 ` , and ` S2 ` .
3737
3838$$
39- y = r_0+ r_1 \frac{S_1}{K_1 + S_1} \frac{S_2}{K_2 + S_2} $$
39+ y = r_0+ r_1 \frac{S_1}{K_1 + S_1} \frac{S_2}{K_2 + S_2}
40+ $$
4041
4142``` {julia}
4243function f_doubleMM(θc::CA.ComponentVector{ET}, x) where ET
@@ -58,7 +59,7 @@ access the components by its symbolic names in the provided `ComponentArray`.
5859HVI requires the evaluation of the likelihood of the predictions.
5960It corresponds to the cost of predictions given some observations.
6061
61- The user specifies a function of the negative log-Likehood
62+ The user specifies a function of the negative log-Likelihood
6263` neg_logden(obs, pred, uncertainty_parameters) ` ,
6364where all of the parameters are arrays with columns for sites.
6465
@@ -239,10 +240,10 @@ given a vector of global parameters, and a matrix of site parameters to
239240invocation of the process based model (PBM), defined at the beginning.
240241
241242``` {julia}
242- f_batch = f_allsites = PBMSiteApplicator(f_doubleMM; θP, θM, θFix, xPvec=xP[:,1])
243+ f_batch = PBMSiteApplicator(f_doubleMM; θP, θM, θFix, xPvec=xP[:,1])
243244
244245prob = HybridProblem(θP, θM, g_chain_scaled, ϕg0,
245- f_batch, f_allsites, priors_dict, py,
246+ f_batch, priors_dict, py,
246247 transM, transP, train_dataloader, n_covar, n_site, n_batch)
247248```
248249
@@ -265,7 +266,7 @@ y1 = f_batch(CA.getdata(θP), CA.getdata(θMs), CA.getdata(x_batch))[2]
265266 #using Cthulhu
266267 #@descend_code_warntype f_batch(CA.getdata(θP), CA.getdata(θMs), CA.getdata(x_batch))
267268 prob0 = HVI.DoubleMM.DoubleMMCase()
268- f_batch0 = get_hybridproblem_PBmodel(prob0; use_all_sites = false )
269+ f_batch0 = get_hybridproblem_PBmodel(prob0)
269270 y1f = f_batch0(θP, θMs, x_batch)[2]
270271 y1 .- y1f # equal
271272end
276277Eventually, having assembled all the moving parts of the HVI, we can perform
277278the inversion.
278279
280+ ``` {julia}
281+ # silence warning of no GPU backend found (because we did not import CUDA here)
282+ ENV["MLDATADEVICES_SILENCE_WARN_NO_GPU"] = 1
283+ ```
284+
279285``` {julia}
280286using OptimizationOptimisers
281287import Zygote
@@ -349,8 +355,7 @@ The HVI Problem needs to be updated with this new applicatior.
349355
350356``` {julia}
351357f_batch = PBMPopulationApplicator(f_doubleMM_sites, n_batch; θP, θM, θFix, xPvec=xP[:,1])
352- f_allsites = PBMPopulationApplicator(f_doubleMM_sites, n_site; θP, θM, θFix, xPvec=xP[:,1])
353- probo_sites = HybridProblem(probo; f_batch, f_allsites)
358+ probo_sites = HybridProblem(probo; f_batch)
354359```
355360
356361For numerical efficiency, the number of sites within one batch is part of the
@@ -380,8 +385,7 @@ module `Main` to allow for easier reloading with JLD2.
380385
381386``` {julia}
382387f_batch = PBMPopulationApplicator(DoubleMM.f_doubleMM_sites, n_batch; θP, θM, θFix, xPvec=xP[:,1])
383- f_allsites = PBMPopulationApplicator(DoubleMM.f_doubleMM_sites, n_site; θP, θM, θFix, xPvec=xP[:,1])
384- probo2 = HybridProblem(probo; f_batch, f_allsites)
388+ probo2 = HybridProblem(probo; f_batch)
385389```
386390
387391``` {julia}
397401#| eval: false
398402#| echo: false
399403probo = load(fname, "probo"; iotype = IOStream);
400- ```
404+ ```
0 commit comments