Skip to content

gpmp-dev/gpmp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

146 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPmp: the Gaussian Process micro package

GPmp is a lightweight toolkit for Gaussian process (GP) modeling. It provides essential components for GP-based algorithms, with emphasis on performance, customization, and transparent parameter selection (ML/REML/REMAP), diagnostics, and posterior sampling (MH/NUTS/SMC). Compared with larger GP frameworks, GPmp favors explicit control of modeling choices and robust behavior in practical workflows. On several benchmark settings, this can translate into stronger predictive performance (e.g., Q2/R2), while keeping the implementation compact.

Features

  • GP interpolation & regression: supports zero, parameterized, and linear-predictor means (including intrinsic kriging).
  • Parameter selection: ML, REML, REMAP, or user-defined criteria.
  • Posterior parameter sampling: Metropolis-Hastings (MH), NUTS, and SMC.
  • Validation & diagnostics: fast leave-one-out predictions and model diagnosis tools.
  • Data handling utilities: random splits, k-fold/repeated CV, and batching.
  • Conditional simulation: generate conditional sample paths.

It is up to the user to write the mean and covariance functions for setting a GP model.

However, for the purpose of the example, GPmp provides functions for:

  • anisotropic scaling
  • distance matrix
  • Matérn kernels with half-integer regularities
  • parameter selection procedures (ML / REML / REMAP / custom)
  • MCMC samplers for parameter posterior exploration (MH / NUTS / SMC)
  • data loader helpers for splitting and batching
  • model diagnosis
  • visualization helper
  • ...

Backends

GPmp supports two numerical backends:

  • NumPy: Default backend; often faster for many small-to-medium workloads.
  • PyTorch: Provides automatic differentiation and is most beneficial when gradients are central and/or in higher-dimensional parameter settings.

Backend selection order at import time:

  1. If GPMP_BACKEND is set to torch or numpy, use it.
  2. Otherwise: PyTorch if available, else NumPy.

Example: export GPMP_BACKEND=torch

optional:

export GPMP_DTYPE=float64

Installation

Clone the repository:

git clone https://github.com/gpmp-dev/gpmp.git

Install in development mode:

pip install -e .

Dependencies

Core:

  • NumPy
  • SciPy
  • Matplotlib

Recommended:

  • PyTorch

Install PyTorch (CPU-only): pip install torch

Verify: python -c "import torch; print(torch.__version__)"

For GPU-enabled PyTorch, install the build matching the local CUDA setup. Use the official PyTorch install selector to obtain the exact pip command.

Quick start

See the examples/ directory.

Typical steps:

  1. Provide mean and covariance functions.
  2. Build a GP model.
  3. Select parameters (ML / REML / custom criterion) and validate model.
  4. Predict / cross-validate / sample conditionally / visualize.

Documentation

GPmp’s documentation is built with Sphinx using the PyData theme. To generate the HTML documentation:

cd docs
make html

How to Cite

If you use GPmp in your research, please cite it as follows:

@software{gpmp2026,
  author       = {Emmanuel Vazquez},
  title        = {GPmp: the Gaussian Process micro package},
  year         = {2026},
  url          = {https://github.com/gpmp-dev/gpmp},
  note         = {Version x.y},
}

Please update the version number as appropriate.

Future Work

  • Expand documentation and tutorials. Improve

Authors

See AUTHORS.md for details.

License

GPmp is free software released under the GNU General Public License v3.0. See LICENSE for more details.

About

GPmp: the Gaussian process micro package

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages