Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JuliaGaussianProcesses/KernelFunctions.jl

Repository files navigation

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.
k1 = SqExponentialKernel()
K1 = kernelmatrix(k1, x)
# Set a function transformation on the data
k2 = Matern32Kernel()  FunctionTransform(sin)
K2 = kernelmatrix(k2, x)
# Set a matrix premultiplication on the data
k3 = PolynomialKernel(; c=2.0, degree=2)  LinearTransform(randn(4, 1))
K3 = kernelmatrix(k3, x)
# Add and sum kernels
k4 = 0.5 * SqExponentialKernel() * LinearKernel(; c=0.5) + 0.4 * k2
K4 = kernelmatrix(k4, x)
plot(
 heatmap.([K1, K2, K3, K4]; yflip=true, colorbar=false)...;
 layout=(2, 2), title=["K1" "K2" "K3" "K4"],
)

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).

AltStyle によって変換されたページ (->オリジナル) /