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.1.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.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kern_gp-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 a2f293b17306c8608c2848c2b2089d101653181e640aadef30e02fdd45444cd9
MD5 d860318b3a3563c7260e4a56ffc45558
BLAKE2b-256 a9683cfbdaba367a8e505ab722e7dc936f4afa5b263c21b52f0511c67b5b02da

See more details on using hashes here.

Provenance

The following attestation bundles were made for kern_gp-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: kern_gp-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f221ba7c23c6ee210127a17a673009884fc1fd82b0be58afd196307ffef308a0
MD5 eddda0b23df5eecef5e9a1c015d419fe
BLAKE2b-256 d2a0ca94b170435af941ee3151be6881ac78664665811d036fef3ce018328218

See more details on using hashes here.

Provenance

The following attestation bundles were made for kern_gp-0.1.1-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