simonschoelly / KernelFunctions.jl

Julia package for kernel functions for machine learning

Home Page:https://juliagaussianprocesses.github.io/KernelFunctions.jl/stable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KernelFunctions.jl

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

Kernel functions for machine learning

KernelFunctions.jl provide a flexible and complete framework for kernel functions, pretransforming the input data.

The aim is to make the API as model-agnostic as possible while still being user-friendly.

Examples

  X = reshape(collect(range(-3.0,3.0,length=100)),:,1)
  # Set simple scaling of the data
  k₁ = SqExponentialKernel()
  K₁ = kernelmatrix(k₁,X,obsdim=1)

  # Set a function transformation on the data
  k₂ = TransformedKernel(Matern32Kernel(),FunctionTransform(x->sin.(x)))
  K₂ = kernelmatrix(k₂,X,obsdim=1)

  # Set a matrix premultiplication on the data
  k₃ = transform(PolynomialKernel(c=2.0,d=2.0),LowRankTransform(randn(4,1)))
  K₃ = kernelmatrix(k₃,X,obsdim=1)

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

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

Packages goals (by priority)

  • Ensure AD Compatibility (already the case for Zygote, ForwardDiff)
  • Toeplitz Matrices compatibility
  • BLAS backend

Directly inspired by the MLKernels package.

Issues/Contributing

If you notice a problem or would like to contribute by adding more kernel functions or features please submit an issue.

About

Julia package for kernel functions for machine learning

https://juliagaussianprocesses.github.io/KernelFunctions.jl/stable/

License:MIT License


Languages

Language:Julia 100.0%