Skip to content

Releases: lanl/PyBNF

v1.6.0

Choose a tag to compare

@wshlavacek wshlavacek released this 05 Jul 22:59

Added

  • qualitative_loss selector and logit penalty model (ADR-0060) — a new logit
    (softplus) qualitative-constraint penalty completes the hinge/probit/logit family,
    and a global qualitative_loss = {auto|hinge|probit|logit} config key re-runs a
    .prop set under any one family, coercing every constraint to it through a shared
    scale currency (a family authored in its own model round-trips to identity). The
    logit gradient rides the existing constraint-gradient path (no assembly change).
  • Estimable qualitative-constraint scale (ADR-0061) — qualitative_scale = fit <param>
    promotes the logit scale (s) / probit tolerance (σ) from a fixed authored value
    to a fittable free parameter estimated jointly with the model parameters, globally
    tied across all qualitative constraints (one nuisance parameter, the identifiable
    case). Includes its closed-form d(penalty)/d(scale) contribution on the scalar
    gradient path, mirroring the estimated-noise pattern.
  • Online documentation on GitHub Pageshttps://lanl.github.io/PyBNF/, built
    from the Sphinx sources and deployed via GitHub Actions (interim host while Read the
    Docs access is provisioned). New pronghorn logo/favicon and a populated
    pybnf.algorithms API reference.

Fixed

  • Packaging: the built wheel is now PyPI-uploadable. The tests extra pinned petab
    to a git+ URL, which setuptools wrote into the wheel's Requires-Dist; PyPI rejects
    any upload whose metadata carries a direct (git+) reference. Reverted the extra to
    stock petab>=0.8,<1 — the sdist and wheel now pass twine check with zero direct
    references. The CI native-BNGL oracle still gets the fork via the setup-pybnf
    action's input, so there is no test-coverage impact.
  • Corrected typos in the fatal-error (CancelledError) message, and migrated the
    in-code documentation links from readthedocs.io to the GitHub Pages URL.

Changed

  • The Sphinx documentation build is warning-clean and now enforced with -W
    (warnings-as-errors) in CI, so a malformed docstring or RST fails the docs job.

v1.5.0

Choose a tag to compare

@wshlavacek wshlavacek released this 05 Jul 07:29

Added

  • HMC / NUTS reference sampler (job_type = hmc, ADR-0059, closing #425's sampler item) — a gradient-based No-U-Turn sampler (blackjax NUTS) for differentiable targets, the reference against which PyBNF's simulator-path samplers are judged. It runs only on the analytical/bring-your-own surface (the named analytical menu, objective = expression, and the full 16-family prior set), which it lowers to JAX: an expression NLL goes sympy→JAX, every prior family gains a logpdf_jax, and a log-scaled or bounded parameter is mapped to an unconstrained space through an unconstraining bijection so NUTS samples on ℝⁿ and transforms back. jax/blackjax are an optional extra, lazily imported (core stays dependency-free), and a simulator model is rejected with a pointed error — HMC is deliberately analytical-only, not a general fitter. New banana / multimodal / rotated-quartic stress geometries exercise the sampler. (#425, ADR-0059)
  • Bring-your-own & analytical objectives (ADR-0050, closing #425's objective item) — three fileless ways to name the objective directly in the .conf, with no .bngl model and no .exp data required. objective = expression + expression = <PEtab-math> compiles an inline negative-log-likelihood over the declared free parameters (bind-by-name; PEtab arithmetic, so ^ not **) down to a numpy callable that is also fully HMC-differentiable via the sympy→JAX path. objective = callable + callable = module:func (or file.py:func) hands scoring to an arbitrary Python function (gradient-free). Both bind experimental data with data = f.exp, …: a callable receives a {name: Data} map, while a data-bound expression is evaluated per observation over the .exp columns and summed (still differentiable end to end). A named analytical menuobjective = banana, a=1, b=100 and its siblings (rosenbrock, rotated quartic, …) — supplies closed-form test targets inline with their coordinates bound by name and no .target sidecar file. Documented in the new docs/analytical_objectives.rst. (#425, ADR-0050)
  • Gradient-based optimizers (job_type = trf / lbfgs, #386) — two deterministic local optimizers that consume the new analytic objective gradient (#385): trf, a Trust-Region-Reflective / Levenberg–Marquardt least-squares solver over the residual Jacobian with proper bound handling (#460), and lbfgs, a full L-BFGS-B (generalized Cauchy point + subspace minimization) over the scalar objective. Both support box-sampled concurrent multi-start (keep-best), a discrete-events pre-flight gate that refuses a model whose gradient would be wrong (#461), and settable-from-.conf tunables (the trf / lbfgs / powell_line_tol knobs are now registered). (#386, #385)
  • Analytic objective-gradient engine (pybnf/gradient/, #385) — the sensitivity-and-gradient infrastructure the gradient optimizers (#386) and standalone profile likelihood (#446) stand on. Forward output-sensitivity tensors are preserved through net execution (#447) with free parameters routed to bngsim's sensitivity_params / sensitivity_ic (#448) and assembled into the residual Jacobian and scalar objective gradient (#449). Coverage spans the whole objective surface: estimated-σ noise-scale columns (#451), log/lognormal scale (#452), trajectory-transform + normalization (#453), asymmetric/non-Gaussian families (Laplace, Student-t, mean-vs-median centering; #454, plus the MEAN-on-log-scale offset/noise coupling), constraint and qualitative/comparison penalties (#456), the SBML/Antimony measurement-model seam (#455), pre-equilibration/steady-state sensitivity continuity (#457), and the negative-binomial noise gradient via median CDF-inversion implicit differentiation (#458) — plus a Student-t exact sqrt-loss residual for LM/TRF (#459). (#385)
  • Standalone profile_likelihood job type (job_type = profile_likelihood, #446) — likelihood-profile identifiability analysis as a first-class run: for each parameter it profiles the objective along a fixed grid, re-optimizing the others at each point through an exact inner path and an L-BFGS-B inner path (so it also profiles non-exact objectives). It emits profile plots and resumable per-point state, and parallelizes across parameters. (#446)
  • SBML/Antimony assignment-rule observables (#463#465) — the measurement-model layer now resolves an observable defined by an SBML assignment rule by inlining the rule's right-hand side (#465), routes Antimony (.ant) models through the SBML formula namespace (#463), and excludes assignment-rule variables from that namespace so they don't shadow species (#464). (#463, #464, #465)
  • AIC / BIC / AICc for likelihood fits — a fit scored with a proper (normalized) likelihood objective now reports the information criteria for the best-fit parameter set: AIC = 2k − 2·lnL, BIC = k·ln n − 2·lnL, and AICc = AIC + 2k(k+1)/(n−k−1) (the last reported n/a when n ≤ k+1). Because the reported log-likelihood is the full normalized density (the same gate LOO/WAIC use, ADR-0056), the AIC is an absolute value comparable across noise families and data sets — the first-class form of the model-selection arithmetic the tutorial computes by hand.
  • Native BNGL PEtab-loader hardening (#437, #420) — the dependency-free BNGL reader behind PyBNF's PEtab lint/import path now joins line continuations, strips BNGL line labels (indexed and named), and drops the molecules/rules block aliases so it matches BNG2.pl exactly, pinned by a corpus regression gate that differentials the reader against BNG2.pl; a CI leg now runs the native loader. (#437, #420)
  • Worked-example tutorial series + interactive notebooks — a 46-lesson tutorial catalog spanning the toolbox (optimizer bake-offs and local-optimizer contrasts, Bayesian uncertainty and the full sampler family, robust/count/relative/lognormal noise models, per-observable and column-joint profile objectives, PEtab v2 round-trips and the lint clinic, gradient fitting and profile-likelihood identifiability, checkpoint/resume, model selection, and BPSL model checking) plus an interactive Jupyter notebook collection for PyBNF + bngsim.
  • Student-t (robust-regression) noise family (ADR-0058, closing the second half of #438 item 1 — item 1 is now fully done) — noise_model = student_t, sigma = <source>[, df = <source>] gives the heavy-tailed, outlier-robust observation likelihood: a normal with a tail-heaviness knob df (degrees of freedom), where small df produces fat tails that downweight outliers and df → ∞ recovers the Gaussian (the noise analogue of the robust student_t prior from ADR-0057, and Stan's/PyMC's student_t(ν, μ, σ)). It is the first two-parameter noise family: sigma (scale) and df (shape) are each independently sourced (fix_at a constant or fit a free parameter), so a fit may estimate 0, 1, or 2 noise parameters — a fixed-df robust fit (just sigma free), both free, or anything between. df is the one parameter that may be omitted, defaulting to a fixed 4 (the standard Stan/Gelman robust default), so noise_model = student_t, sigma = fit s__FREE is a complete robust fit; estimating df is weakly identified, so pair df = fit nu__FREE with a positive prior on it (the gamma/half_* families ADR-0057 added compose exactly here). The per-point NLL is scipy.stats.t.logpdf-exact: data_fit = (ν+1)/2·log(1 + z²/ν), the log σ normalizer summed iff sigma is estimated, and the df-block (−logΓ((ν+1)/2) + logΓ(ν/2) + ½log(νπ)) summed iff df is estimated — when df is fixed that block is a constant the sampler drops, when df is free it is the term that keeps the fit honest, and either way it rides into log_density so LOO/WAIC (ADR-0056) see the complete normalized density. The noise engine generalized to source a mapping of noise parameters (was exactly one): a spec is now (family, {param: source}), each family declares its own noise_params (retiring the engine's parallel name table) plus a per-parameter param_normalizers keyed by name, and the objective gates each parameter's normalizer on its own source's estimated-ness — a backward-compatible extension (the single-parameter families gain only a declared name and an ignored trailing argument; their scores are byte-identical) mirroring ADR-0057's trailing-p3 prior-carrier extension. Student-t is exposed only through the noise_model surface (no objective = student_t token), on the linear scale (it is symmetric there, so location = mean and median coincide); on a log scale it has no finite mean (its tails are too heavy for any df), so location = mean there raises and only median is safe. PEtab v2 has no Student-t noiseDistribution, so the family is PyBNF-native and not part of the PEtab round-trip. (#438, ADR-0058)
  • Eight new prior families + a three-parameter prior carrier (ADR-0057, closing the prior-family half of #438 item 1) — the batch univariate priors Bayesian modelers reach for, each a scipy.stats-backed leaf in pybnf/priors/ that self-registers and gets its {base}_var / log{base}_var / ln{base}_var keywords for free (ADR-0010): half_normal / half_cauchy (the standard weakly-informative scale priors, one parameter — the underlying scale), beta (bounded [0,1], for fractions/probabilities), inv_gamma (the conjugate variance prior), weibull (lifetime/time-to-event), gumbel (extreme-value/max), logistic (a heavier-tailed Normal sibling), and student_t (the heavy-tailed robust prior — a drop-in for a Normal prior that tolerates outliers). Seven are pure two-or-fewer-parameter leaves usable on both the legacy positional *_var line and the new-era parameter: record (e.g. half_normal_var = k__FREE 2 or parameter: k, prior: beta, alpha: 2, beta: 5); each is oracled against its scipy distribution and inherits the ...
Read more

v1.1.9

Choose a tag to compare

@wshlavacek wshlavacek released this 21 Sep 18:17
abd61b6

In PyBNF version 1.1.9, am was added as a new option for fit_type. When am is selected (fit_type=am in a CONF file), PyBNF executes an adaptive Markov chain Monte Carlo (MCMC) sampling algorithm. The am method has several method-specific options: stablizingCov, adaptive, output_noise_trajectory, output_trajectory, continue_run, calculate_covari, and starting_params. We recommend that am should be used instead of mh. Version 1.1.9 also adds support for new settings for objfunc. When objfunc=neg_bin in a CONF file, PyBNF uses a negative binomial likelihood function in optimization or MCMC sampling. When objfunc=neg_bin_dynamic, PyBNF uses a negative binomial likelihood function in optimization or MCMC sampling and infers the hyperparameter r (dispersion) jointly with model parameters. When objfunc=kl, PyBNF uses the Kullback-Leibler divergence as an objective function in optimization. When objfunc=chi_sq_dynamic, PyBNF uses a Gaussian likelihood function in optimization or MCMC sampling and jointly infers the hyperparameter sigma (standard deviation) jointly with model parameters. The online manual has been updated to explain new features. Please note that versions 1.1.3 through 1.1.8 are prereleases of 1.1.9 and should NOT be used.

v1.1.2

Choose a tag to compare

@emitra17 emitra17 released this 31 Dec 17:26
697d96d

Fixes a version conflict between msgpack and distributed that was breaking new installs

v1.1.1

Choose a tag to compare

@emitra17 emitra17 released this 22 Aug 23:13

Adds support for the once between enforcement condition in BPSL

v1.1.0

Choose a tag to compare

@emitra17 emitra17 released this 22 Aug 23:02

Adds support for using a likelihood-based objective function for qualitative data, using the new BPSL keywords confidence, tolerance, pmin, pmax

v1.0.1

Choose a tag to compare

@emitra17 emitra17 released this 05 Jul 23:10

Added some support for Windows operating systems.

v1.0.0

Choose a tag to compare

@emitra17 emitra17 released this 15 Mar 16:17

First stable release of PyBNF.

v0.3.3 Beta

v0.3.3 Beta Pre-release
Pre-release

Choose a tag to compare

@emitra17 emitra17 released this 05 Mar 16:05

Performs some formatting changes in preparation for the first stable release. Most notably, adds HTML documentation, and changes file extension convention from ".con" to ".prop"

v0.3.2 Beta

v0.3.2 Beta Pre-release
Pre-release

Choose a tag to compare

@emitra17 emitra17 released this 08 Jan 18:59

Fixed bugs. Added model checking and multimodel parallelism.