• Stars
    star
    267
  • Rank 153,408 (Top 4 %)
  • Language
    Julia
  • License
    MIT License
  • Created over 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Julia package for kernel functions for machine learning

KernelFunctions.jl

CI codecov Documentation (stable) Documentation (latest) ColPrac: Contributor's Guide on Collaborative Practices for Community Packages Code Style: Blue DOI

Kernel functions for machine learning

KernelFunctions.jl is a general purpose kernel package. It provides a flexible framework for creating kernel functions and manipulating them, and an extensive collection of implementations. The main goals of this package are:

  • Flexibility: operations between kernels should be fluid and easy without breaking, with a user-friendly API.
  • Plug-and-play: being model-agnostic; including the kernels before/after other steps should be straightforward. To interoperate well with generic packages for handling parameters like ParameterHandling.jl and FluxML's Functors.jl.
  • Automatic Differentiation compatibility: all kernel functions which ought to be differentiable using AD packages like ForwardDiff.jl or Zygote.jl should be.

Examples

x = range(-3.0, 3.0; length=100)

# A simple standardised squared-exponential / exponentiated-quadratic kernel.
k₁ = SqExponentialKernel()
K₁ = kernelmatrix(k₁, x)

# Set a function transformation on the data
k₂ = Matern32Kernel()  FunctionTransform(sin)
K₂ = kernelmatrix(k₂, x)

# Set a matrix premultiplication on the data
k₃ = PolynomialKernel(; c=2.0, degree=2)  LinearTransform(randn(4, 1))
K₃ = kernelmatrix(k₃, x)

# Add and sum kernels
k₄ = 0.5 * SqExponentialKernel() * LinearKernel(; c=0.5) + 0.4 * k₂
K₄ = kernelmatrix(k₄, x)

plot(
    heatmap.([K₁, K₂, K₃, K₄]; yflip=true, colorbar=false)...;
    layout=(2, 2), title=["K₁" "K₂" "K₃" "K₄"],
)

Related Work

This package replaces the now-defunct MLKernels.jl. It incorporates lots of excellent existing work from packages such as GaussianProcesses.jl, and is used in downstream packages such as AbstractGPs.jl, ApproximateGPs.jl, Stheno.jl, and AugmentedGaussianProcesses.jl.

See the JuliaGaussianProcesses Github organisation and website for more information.

Issues/Contributing

If you notice a problem or would like to contribute by adding more kernel functions or features please submit an issue, or open a PR (please see the ColPrac contribution guidelines).

More Repositories

1

Stheno.jl

Probabilistic Programming with Gaussian processes in Julia
Julia
340
star
2

AbstractGPs.jl

Abstract types and methods for Gaussian Processes.
Julia
219
star
3

TemporalGPs.jl

Fast inference for Gaussian processes in problems involving time. Partly built on results from https://proceedings.mlr.press/v161/tebbutt21a.html
Julia
121
star
4

ParameterHandling.jl

Foundational tooling for handling collections of parameters in models
Julia
72
star
5

GPLikelihoods.jl

Provides likelihood functions for Gaussian Processes.
Julia
43
star
6

ApproximateGPs.jl

Approximations for Gaussian processes: sparse variational inducing point approximations, Laplace approximation, ...
Julia
35
star
7

BayesianLinearRegressors.jl

Bayesian Linear Regression in Julia
Julia
30
star
8

AugmentedGPLikelihoods.jl

Provide all functions needed to work with augmented likelihoods (conditionally conjugate with Gaussians)
Julia
20
star
9

InducingPoints.jl

Package for different inducing points selection methods
Julia
8
star
10

LinearMixingModels.jl

http://proceedings.mlr.press/v119/bruinsma20a.html
Julia
6
star
11

KernelSpectralDensities.jl

Julia
6
star
12

RandomFourierFeatures.jl

[WIP] Random Fourier Feature approximations for KernelFunctions.jl
Julia
3
star
13

EasyGPs.jl

Easy automatic fitting of JuliaGP models
Julia
3
star
14

AbstractGPsMakie.jl

Plots of Gaussian processes with AbstractGPs and Makie
Julia
2
star
15

JuliaGPsDocs.jl

General setup to generate examples for the JuliaGP packages
Julia
1
star
16

JuliaGaussianProcesses.github.io

Website for the JuliaGaussianProcesses organisation and its packages
HTML
1
star