Skip to main content

Gaussian processes with arbitrary kernels

Project description

Kernel only GP

A minimal Python package for GP inference given only kernel matrices — not the underlying data points. Useful when working with data that cannot be stored as a tensor.

Usage

import jax.numpy as jnp
import kern_gp

# Kernel matrices (e.g. from an RBF kernel evaluated on your data)
# In this package, *these* are the GP inputs (not the data)
k_train_train = jnp.array([[1.0, 0.8], [0.8, 1.0]])
k_test_train  = jnp.array([[0.6, 0.9]])
k_test_test   = jnp.array([[1.0]])

y_train = jnp.array([1.2, 0.8])

# Hyperparameters: output scale and noise variance
a = 1.0   # output scale
s = 0.01  # noise variance

# Marginal log likelihood (useful for training / hyperparameter selection)
mll = kern_gp.mll_train(a, s, k_train_train, y_train)

# Posterior mean and covariance at test points (noise not added back)
mean, covar = kern_gp.noiseless_predict(a, s, k_train_train, k_test_train, k_test_test, y_train)

The kernel matrices should use the base kernel (without the output scale a). The full GP kernel is a·k(x,x') + s·I, where s is the noise variance.

Installation

pip install kern-gp

Development

# Install all deps (including dev group)
uv sync

# Install pre-commit hooks
uv run pre-commit install

# Run tests
uv run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kern_gp-0.1.2.tar.gz (127.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kern_gp-0.1.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file kern_gp-0.1.2.tar.gz.

File metadata

  • Download URL: kern_gp-0.1.2.tar.gz
  • Upload date:
  • Size: 127.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kern_gp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6295810a7725579bfaabc81c3f45ba6142414ca6cb3fca547d3dc599cee01945
MD5 f645bf78d29208ea524c775d153347da
BLAKE2b-256 86fc50076c3aa16ce52e1c679b983e08cca9bf391db01ae9017372fef287528b

See more details on using hashes here.

Provenance

The following attestation bundles were made for kern_gp-0.1.2.tar.gz:

Publisher: publish.yml on AustinT/kernel-only-GP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kern_gp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: kern_gp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kern_gp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 671563395904ec1ff7d30691b00ea0eb42b8fc821a643fe5b43bb122075e2657
MD5 71ef76813819fdf0d469d6f9d0cffbee
BLAKE2b-256 20166e18270f3405aed08985a0ca03d75163deac55a42dbee9d332076b263125

See more details on using hashes here.

Provenance

The following attestation bundles were made for kern_gp-0.1.2-py3-none-any.whl:

Publisher: publish.yml on AustinT/kernel-only-GP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page