Skip to content

v1.1.0

Choose a tag to compare

@lacerbi lacerbi released this 05 Sep 13:06
a2f8ddc

What's Changed

Performance

  • GP.predict calls LAPACK's triangular solve directly instead of through scipy's wrapper layers (same numbers), broadcasts sW instead of tiling it, evaluates the mean function for all hyperparameter samples in one call and returns the squared-exponential diagonal without computing distances: about 1.5–1.7× faster per call at the sizes PyVBMC uses (#43).
  • The slice sampler's log-posterior evaluation builds the symmetric kernel matrix with cdist, adds the noise in place on the diagonal, caches the hyperprior's type masks, and reuses the Cholesky factor when only mean-function hyperparameters move between evaluations: one GP.fit about 2–2.5× faster (#43).
  • Every numerical output is bit-identical to the previous release, checked over 2219 arrays of random GPs (every predict branch, both factorization regimes, three kernels, three mean functions, per-point noise, the rank-1 update, the Cholesky retry ladder, random_function, seeded fits) and by the PyVBMC and PyBADS test suites.

Features

  • rng= on GP.fit, SliceSampler, f_min_fill and GP.random_function: pass a numpy.random.Generator (or a seed) and the space-filling design and the sampler draw from it. The default keeps drawing from NumPy's global legacy stream, call for call as before. New module gpyreg.rng (resolve_rng, random_integer).
  • compute_batched on ZeroMean, ConstantMean and NegativeQuadratic: the mean for all hyperparameter samples at once. A subclass that overrides compute alone keeps its behavior.

Bug Fixes

  • GP.log_likelihood and GP.log_posterior with compute_grad=True raised TypeError; they return (value, gradient).

Notes

  • The hyperprior's type masks are cached on the GP and reset by set_priors, set_bounds and fit; change priors or bounds through those methods rather than by mutating the arrays in place.
  • A SliceSampler created without rng= can be copied and pickled; the legacy stream is represented by a small picklable proxy.

Full Changelog: v1.0.4...v1.1.0