### Install Documentation Packages Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/README.md Install all necessary packages for the documentation environment. This command ensures all dependencies are met. ```julia julia> ] instantiate ``` -------------------------------- ### Activate Documentation Environment Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/README.md Activate the documentation environment for KernelFunctions.jl. This is the first step before installing packages or building the documentation. ```julia julia> ] activate . ``` -------------------------------- ### Define SimpleKernel with Custom Metric Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/create_kernel.md Construct a custom kernel that depends on a metric by defining `kappa` and `metric`. This example redefines `SqExponentialKernel`. ```julia struct MyKernel <: KernelFunctions.SimpleKernel end KernelFunctions.kappa(::MyKernel, d2::Real) = exp(-d2) KernelFunctions.metric(::MyKernel) = SqEuclidean() ``` -------------------------------- ### Define Custom Kernel with Direct Evaluation Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/create_kernel.md Implement a custom kernel for complex scenarios by defining the `(k::MyKernel)(x, y)` function directly. This example recreates `NeuralNetworkKernel`. ```julia struct MyKernel <: KernelFunctions.Kernel end (::MyKernel)(x, y) = asin(dot(x, y) / sqrt((1 + sum(abs2, x)) * (1 + sum(abs2, y)))) ``` -------------------------------- ### Basic Kernel Usage and Matrix Generation Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/README.md Demonstrates the creation of different kernel types (SqExponentialKernel, Matern32Kernel, PolynomialKernel) and their application with transformations (FunctionTransform, LinearTransform). It also shows how to combine kernels using addition and multiplication, and generate kernel matrices. ```julia 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₄"], ) ``` -------------------------------- ### Build Documentation Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/README.md Execute the make.jl script to build the documentation. This command compiles the documentation pages. ```julia julia> include("make.jl") ``` -------------------------------- ### Create Kernel Matrix using obsdim=2 Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Demonstrates creating a kernel matrix by specifying the observation dimension as 2, treating columns as inputs. ```julia k = SqExponentialKernel() X = rand(10, 5) kernelmatrix(k, X; obsdim=2) # same as ColVecs(X) ``` -------------------------------- ### Create Composite Kernels using Operators Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Demonstrates creating composite kernels (sums and products) using the '+' and '*' operators with predefined kernel types. ```julia k1 = SqExponentialKernel() k2 = Matern32Kernel() k = 0.5 * k1 + 0.2 * k2 # KernelSum k = k1 * k2 # KernelProduct ``` -------------------------------- ### Run All Tests Locally Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/CONTRIBUTING.md Execute 'make test' in the Julia REPL within the KernelFunctions development directory to run the entire test suite. Consider commenting out specific test blocks in 'test/runtests.jl' to speed up development. ```bash make test ``` -------------------------------- ### Create Kernel Matrix using obsdim=1 Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Demonstrates creating a kernel matrix by specifying the observation dimension as 1, treating rows as inputs. ```julia k = SqExponentialKernel() X = rand(10, 5) kernelmatrix(k, X; obsdim=1) # same as RowVecs(X) ``` -------------------------------- ### Create a Kronecker Matrix with Scalar Input Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Shows how to create a Kronecker matrix using a single range and a specified length. ```julia using Kronecker k = SqExponentialKernel() x = range(0, 1; length=10) K = kernelkronmat(k, x, 5) # Kronecker matrix ``` -------------------------------- ### Create a Kronecker Matrix Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Demonstrates creating a Kronecker matrix from a list of ranges, suitable for specific kernel constructions. ```julia using Kronecker k = SqExponentialKernel() x = range(0, 1; length=10) y = range(0, 1; length=50) K = kernelkronmat(k, [x, y]) # Kronecker matrix ``` -------------------------------- ### Format Code Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/CONTRIBUTING.md Run 'make format' before pushing changes to ensure code consistency. This command formats the code according to the project's standards. ```bash make format ``` -------------------------------- ### Create a Kernel Matrix for 1D Inputs Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Shows how to create a 10x10 kernel matrix from a collection of 10 real-valued inputs. ```julia k = SqExponentialKernel() x = rand(10) kernelmatrix(k, x) # 10x10 matrix ``` -------------------------------- ### Optimize Kernel Parameters with Flux.jl Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Illustrates how to access trainable kernel parameters and compute gradients using Flux.jl for optimization. ```julia using Flux kernelparams = Flux.params(k) Flux.gradient(kernelparams) do # ... some loss function on the kernel .... end ``` -------------------------------- ### Multi-Output Kernel as Standard Kernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/design.md This code demonstrates how a matrix-valued kernel can be represented as a standard kernel by extending the input domain to include output indices. This allows multi-output kernels to be used seamlessly with existing single-output kernel machinery. ```julia k((x, p), (y, q)) = k_mat(x, y)[p, q] ``` -------------------------------- ### FBMKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The FBMKernel implements the Fractional Brownian Motion kernel, a base kernel for modeling fractal processes. ```APIDOC ## FBMKernel ### Description The FBMKernel implements the Fractional Brownian Motion kernel, a base kernel for modeling fractal processes. ### Constructor ```julia FBMKernel(α::Real=0.5, σ²::Real=1.0) ``` ``` -------------------------------- ### Add New Dependency via Shell Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/README.md Add a new package dependency to the documentation environment using a shell command. This is an alternative to using the Julia Pkg REPL. ```shell shell julia --project=. -e 'using Pkg; Pkg.add("NewDependency")' ``` -------------------------------- ### prepare_heterotopic_multi_output_data Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Helper function to prepare data for multi-output Gaussian Processes where outputs may have different input domains. ```APIDOC ## Function: prepare_heterotopic_multi_output_data ### Description Helper function to prepare data for multi-output Gaussian Processes where outputs may have different input domains. It transforms commonly found data formats into the `AbstractVector{<:Tuple{T, Int}}` format required by KernelFunctions. ### Method `prepare_heterotopic_multi_output_data(...)` ### Parameters (Specific parameters depend on the input data format, but the function aims to handle common representations.) ### Response Returns data formatted for multi-output GPs. ``` -------------------------------- ### RationalKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The RationalKernel is a base kernel that models rational function relationships between inputs. ```APIDOC ## RationalKernel ### Description The RationalKernel is a base kernel that models rational function relationships between inputs. ### Constructor ```julia RationalKernel(l::Real=1.0, σ²::Real=1.0, α::Real=2.0) ``` ``` -------------------------------- ### MOKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The MOKernel is a multi-output kernel designed for Gaussian processes with multiple output dimensions. ```APIDOC ## MOKernel ### Description The MOKernel is a multi-output kernel designed for Gaussian processes with multiple output dimensions. ### Constructor ```julia MOKernel(k::Kernel, m::Int) ``` ``` -------------------------------- ### prepare_isotopic_multi_output_data Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Helper function to prepare data for multi-output Gaussian Processes where outputs share the same input domain. ```APIDOC ## Function: prepare_isotopic_multi_output_data ### Description Helper function to prepare data for multi-output Gaussian Processes where outputs share the same input domain. It transforms commonly found data formats into the `AbstractVector{<:Tuple{T, Int}}` format required by KernelFunctions. ### Method Signatures 1. `prepare_isotopic_multi_output_data(x::AbstractVector, y::ColVecs)` 2. `prepare_isotopic_multi_output_data(x::AbstractVector, y::RowVecs)` ### Parameters - **x** (AbstractVector): The input locations. - **y** (ColVecs or RowVecs): The output values, structured as columns or rows of a matrix. ### Response Returns data formatted for multi-output GPs. ``` -------------------------------- ### Register a New Release Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/CONTRIBUTING.md To create a new release, navigate to the desired commit on GitHub (typically a squash-merged PR on the 'master' branch that has updated the version number) and add a comment '@JuliaRegistrator register'. This initiates the automated release process. ```git @JuliaRegistrator register ``` -------------------------------- ### GibbsKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The GibbsKernel is a base kernel used in specific probabilistic models. ```APIDOC ## GibbsKernel ### Description The GibbsKernel is a base kernel used in specific probabilistic models. ### Constructor ```julia GibbsKernel(l::Real=1.0, σ²::Real=1.0) ``` ``` -------------------------------- ### Create a Positive-Definite Matrix Output Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Shows how to generate a PDMat object, which is a positive-definite matrix, potentially with added diagonal noise for conditioning. ```julia using PDMats k = SqExponentialKernel() X = rand(10, 5) K = kernelpdmat(k, RowVecs(X)) # PDMat ``` ```julia using PDMats k = SqExponentialKernel() X = rand(10, 5) K = kernelpdmat(k, X; obsdim=1) # PDMat ``` -------------------------------- ### Develop KernelFunctions Package Locally Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/CONTRIBUTING.md Use this command to develop the KernelFunctions package locally in the Julia REPL. This is a prerequisite for running tests locally. ```julia using Pkg; Pkg.develop("KernelFunctions") ``` -------------------------------- ### PeriodicKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The PeriodicKernel is a base kernel that models periodic behavior in the data. ```APIDOC ## PeriodicKernel ### Description The PeriodicKernel is a base kernel that models periodic behavior in the data. ### Constructor ```julia PeriodicKernel(l::Real=1.0, σ²::Real=1.0, p::Int=1) PeriodicKernel(::DataType, ::Int) ``` ``` -------------------------------- ### Compose Kernel with ScaleTransform Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/transform.md Demonstrates composing a LowRankTransform with a ScaleTransform using the ∘ operator. This creates a transformed kernel, potentially allowing for optimized implementations. ```julia LowRankTransform(rand(10, 5)) ∘ ScaleTransform(2.0) ``` -------------------------------- ### ZeroKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The ZeroKernel represents a kernel with a value of zero for all inputs. It is a base kernel. ```APIDOC ## ZeroKernel ### Description The ZeroKernel represents a kernel with a value of zero for all inputs. It is a base kernel. ### Constructor ```julia ZeroKernel() ``` ``` -------------------------------- ### Prepare Heterotopic Multi-Output Data Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Helper function to prepare data for heterotopic multi-output GPs. Transforms common data formats into the required AbstractVector{<:Tuple{T, Int}} format. ```julia prepare_heterotopic_multi_output_data ``` -------------------------------- ### Matern72Kernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The Matern72Kernel is a specific instance of the MaternKernel with ν=3.5, providing even higher smoothness. ```APIDOC ## Matern72Kernel ### Description The Matern72Kernel is a specific instance of the MaternKernel with ν=3.5, providing even higher smoothness. ### Constructor ```julia Matern72Kernel(l::Real=1.0, σ²::Real=1.0) ``` ``` -------------------------------- ### GammaRationalKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The GammaRationalKernel is a base kernel that combines rational functions with a gamma parameter for increased flexibility. ```APIDOC ## GammaRationalKernel ### Description The GammaRationalKernel is a base kernel that combines rational functions with a gamma parameter for increased flexibility. ### Constructor ```julia GammaRationalKernel(l::Real=1.0, σ²::Real=1.0, α::Real=2.0, γ::Real=1.0) ``` ``` -------------------------------- ### SEKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The SEKernel is an alias for the Squared Exponential Kernel (SqExponentialKernel), a common base kernel. ```APIDOC ## SEKernel ### Description The SEKernel is an alias for the Squared Exponential Kernel (SqExponentialKernel), a common base kernel. ### Constructor ```julia SEKernel(l::Real=1.0, σ²::Real=1.0) ``` ``` -------------------------------- ### Kernel Matrix Computation with KernelSum (Matrix Input) Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/design.md This snippet shows how a KernelSum might implement kernelmatrix when inputs are provided as an AbstractMatrix. It requires an 'obsdim' argument to specify data orientation. ```julia function kernelmatrix(k::KernelSum, x::AbstractMatrix; obsdim=1) return kernelmatrix(k.kernels[1], x; obsdim=obsdim) + kernelmatrix(k.kernels[2], x; obsdim=obsdim) end ``` -------------------------------- ### Matern32Kernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The Matern32Kernel is a specific instance of the MaternKernel with ν=1.5, providing a balance between smoothness and flexibility. ```APIDOC ## Matern32Kernel ### Description The Matern32Kernel is a specific instance of the MaternKernel with ν=1.5, providing a balance between smoothness and flexibility. ### Constructor ```julia Matern32Kernel(l::Real=1.0, σ²::Real=1.0) ``` ``` -------------------------------- ### LaplacianKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The LaplacianKernel is a base kernel related to the exponential kernel, characterized by its Laplacian distribution-based decay. ```APIDOC ## LaplacianKernel ### Description The LaplacianKernel is a base kernel related to the exponential kernel, characterized by its Laplacian distribution-based decay. ### Constructor ```julia LaplacianKernel(l::Real=1.0, σ²::Real=1.0) ``` ``` -------------------------------- ### GammaExponentialKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The GammaExponentialKernel is a base kernel that generalizes the ExponentialKernel with a gamma parameter. ```APIDOC ## GammaExponentialKernel ### Description The GammaExponentialKernel is a base kernel that generalizes the ExponentialKernel with a gamma parameter. ### Constructor ```julia GammaExponentialKernel(l::Real=1.0, σ²::Real=1.0, γ::Real=1.0) ``` ``` -------------------------------- ### RationalQuadraticKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The RationalQuadraticKernel is a base kernel that models rational quadratic relationships between inputs, offering more flexibility than the RationalKernel. ```APIDOC ## RationalQuadraticKernel ### Description The RationalQuadraticKernel is a base kernel that models rational quadratic relationships between inputs, offering more flexibility than the RationalKernel. ### Constructor ```julia RationalQuadraticKernel(l::Real=1.0, σ²::Real=1.0, α::Real=2.0) ``` ``` -------------------------------- ### gaborkernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The gaborkernel is a base kernel based on the Gabor function, useful for analyzing signals with frequency and time localization. ```APIDOC ## gaborkernel ### Description The gaborkernel is a base kernel based on the Gabor function, useful for analyzing signals with frequency and time localization. ### Constructor ```julia gaborkernel(l::Real=1.0, σ²::Real=1.0, f₀::Real=1.0) ``` ``` -------------------------------- ### Kernel Matrix Computation with KernelSum (Vector Input) Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/design.md This snippet demonstrates a simplified kernelmatrix implementation for a KernelSum when inputs are represented as an AbstractVector. This version is cleaner and avoids the need for an 'obsdim' argument. ```julia function kernelmatrix(k::KernelSum, x::AbstractVector) return kernelmatrix(k.kernels[1], x) + kernelmatrix(k.kernels[2], x) end ``` -------------------------------- ### Add New Dependency to Docs Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/README.md Add a new package dependency to the documentation environment. This command is used when additional packages are required for documentation. ```julia julia> ] add NewDependency ``` -------------------------------- ### Create Squared Exponential Kernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Instantiates a default Squared Exponential kernel object. ```julia k = SqExponentialKernel() ``` -------------------------------- ### Nystrom Approximation for Kernel Matrix Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Illustrates how to compute a Nystrom approximation of a kernel matrix using a specified fraction of data samples. ```julia k = SqExponentialKernel() X = rand(10, 5) ρ = 0.5 # fraction of data samples kernelmatrix(nystrom(k, X, ρ, obsdim=1)) ``` -------------------------------- ### GaussianKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The GaussianKernel is a base kernel based on the Gaussian function, similar to the SqExponentialKernel. ```APIDOC ## GaussianKernel ### Description The GaussianKernel is a base kernel based on the Gaussian function, similar to the SqExponentialKernel. ### Constructor ```julia GaussianKernel(l::Real=1.0, σ²::Real=1.0) ``` ``` -------------------------------- ### Prepare Isotopic Multi-Output Data Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Helper function to prepare data for isotopic multi-output GPs. Transforms common data formats into the required AbstractVector{<:Tuple{T, Int}} format. ```julia prepare_isotopic_multi_output_data(x::AbstractVector, y::ColVecs) ``` ```julia prepare_isotopic_multi_output_data(x::AbstractVector, y::RowVecs) ``` -------------------------------- ### ScaledKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The ScaledKernel is a composite kernel that scales the output of a base kernel by a constant factor. ```APIDOC ## ScaledKernel ### Description The ScaledKernel is a composite kernel that scales the output of a base kernel by a constant factor. ### Constructor ```julia ScaledKernel(k::Kernel, σ²::Real) ``` ``` -------------------------------- ### Handle Multi-dimensional Inputs with ColVecs Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Illustrates creating a 5x5 kernel matrix where each column of the input matrix X is treated as a separate input vector. ```julia X = rand(10, 5) k = SqExponentialKernel() kernelmatrix(k, ColVecs(X)) # returns a 5×5 matrix -- each column of X treated as input ``` -------------------------------- ### IndependentMOKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The IndependentMOKernel is a multi-output kernel where each output dimension is modeled independently by a scalar kernel. ```APIDOC ## IndependentMOKernel ### Description The IndependentMOKernel is a multi-output kernel where each output dimension is modeled independently by a scalar kernel. ### Constructor ```julia IndependentMOKernel(k::Kernel, m::Int) ``` ``` -------------------------------- ### Check Kronecker Compatibility Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Checks if two kernels are compatible for Kronecker product operations. Requires Kronecker.jl. ```julia iskroncompatible(k1::Kernel, k2::Kernel) ``` -------------------------------- ### Matern52Kernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The Matern52Kernel is a specific instance of the MaternKernel with ν=2.5, offering higher smoothness. ```APIDOC ## Matern52Kernel ### Description The Matern52Kernel is a specific instance of the MaternKernel with ν=2.5, offering higher smoothness. ### Constructor ```julia Matern52Kernel(l::Real=1.0, σ²::Real=1.0) ``` ``` -------------------------------- ### ExponentialKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The ExponentialKernel is a base kernel with an exponential decay. It is also known as the Laplace kernel. ```APIDOC ## ExponentialKernel ### Description The ExponentialKernel is a base kernel with an exponential decay. It is also known as the Laplace kernel. ### Constructor ```julia ExponentialKernel(l::Real=1.0, σ²::Real=1.0) ``` ``` -------------------------------- ### iskroncompatible Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Checks if a kernel is compatible with Kronecker product operations. ```APIDOC ## Function: iskroncompatible ### Description Checks if a kernel is compatible with Kronecker product operations. This is useful when working with Kronecker.jl for efficient computations involving multiple kernels. ### Method `iskroncompatible(k::Kernel)` ### Parameters - **k** (Kernel): The kernel function to check. ### Response Returns `true` if the kernel is compatible with Kronecker products, `false` otherwise. ``` -------------------------------- ### PolynomialKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The PolynomialKernel is a base kernel that models polynomial relationships between inputs. ```APIDOC ## PolynomialKernel ### Description The PolynomialKernel is a base kernel that models polynomial relationships between inputs. ### Constructor ```julia PolynomialKernel(c::Real=0.0, σ²::Real=1.0, d::Int=2) ``` ``` -------------------------------- ### ExponentiatedKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The ExponentiatedKernel is a base kernel where the kernel function is exponentiated. ```APIDOC ## ExponentiatedKernel ### Description The ExponentiatedKernel is a base kernel where the kernel function is exponentiated. ### Constructor ```julia ExponentiatedKernel(k::Kernel, p::Real=1.0) ``` ``` -------------------------------- ### ChainTransform Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/transform.md Creates a pipeline of transforms to be applied sequentially. ```APIDOC ## Type: ChainTransform ### Description Creates a pipeline of transforms to be applied sequentially. ### Constructor `ChainTransform(transforms::Tuple)` ### Methods - `t(x)`: Applies each transform in the chain to `x` sequentially. - `map(t, xs)`: Applies each transform in the chain to `xs` sequentially. ``` -------------------------------- ### LinearKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The LinearKernel is a base kernel representing a linear relationship between inputs. ```APIDOC ## LinearKernel ### Description The LinearKernel is a base kernel representing a linear relationship between inputs. ### Constructor ```julia LinearKernel(c::Real=0.0, σ²::Real=1.0) ``` ``` -------------------------------- ### EyeKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The EyeKernel is an identity kernel, often used in specific contexts. It is a base kernel. ```APIDOC ## EyeKernel ### Description The EyeKernel is an identity kernel, often used in specific contexts. It is a base kernel. ### Constructor ```julia EyeKernel() ``` ``` -------------------------------- ### CosineKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The CosineKernel is a base kernel based on the cosine function. ```APIDOC ## CosineKernel ### Description The CosineKernel is a base kernel based on the cosine function. ### Constructor ```julia CosineKernel(l::Real=1.0, σ²::Real=1.0) ``` ``` -------------------------------- ### WhiteKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The WhiteKernel represents a kernel with a constant variance and zero covariance between different points. It is a base kernel. ```APIDOC ## WhiteKernel ### Description The WhiteKernel represents a kernel with a constant variance and zero covariance between different points. It is a base kernel. ### Constructor ```julia WhiteKernel(σ²::Real=1.0) ``` ``` -------------------------------- ### ConstantKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The ConstantKernel represents a constant kernel with a specified value. It is a base kernel. ```APIDOC ## ConstantKernel ### Description The ConstantKernel represents a constant kernel with a specified value. It is a base kernel. ### Constructor ```julia ConstantKernel(c::Real=1.0) ``` ``` -------------------------------- ### Implement a Custom Delta Metric Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/metrics.md Implement a new 'metric' by defining a struct that adheres to Distances.jl's PreMetric interface and providing the evaluation logic. ```julia struct Delta <: Distances.PreMetric end @inline function Distances._evaluate(::Delta,a::AbstractVector{T},b::AbstractVector{T}) where {T} @boundscheck if length(a) != length(b) throw(DimensionMismatch("first array has length $(length(a)) which does not match the length of the second, $(length(b)).")) end return a==b end @inline (dist::Delta)(a::AbstractArray,b::AbstractArray) = Distances._evaluate(dist,a,b) @inline (dist::Delta)(a::Number,b::Number) = a==b ``` -------------------------------- ### NeuralNetworkKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The NeuralNetworkKernel is a base kernel inspired by the architecture of neural networks. ```APIDOC ## NeuralNetworkKernel ### Description The NeuralNetworkKernel is a base kernel inspired by the architecture of neural networks. ### Constructor ```julia NeuralNetworkKernel(Wᵀ::AbstractMatrix, b::AbstractVector, σ::Function=relu) ``` ``` -------------------------------- ### WienerKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The WienerKernel is a base kernel related to the Wiener process, suitable for modeling continuous-time processes. ```APIDOC ## WienerKernel ### Description The WienerKernel is a base kernel related to the Wiener process, suitable for modeling continuous-time processes. ### Constructor ```julia WienerKernel() ``` ``` -------------------------------- ### Handle Multi-dimensional Inputs with RowVecs Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Illustrates creating a 10x10 kernel matrix where each row of the input matrix X is treated as a separate input vector. ```julia X = rand(10, 5) k = SqExponentialKernel() kernelmatrix(k, RowVecs(X)) # returns a 10×10 matrix -- each row of X treated as input ``` -------------------------------- ### Evaluate a Kernel Function Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Demonstrates how to evaluate a kernel function between two vectors using a kernel object. ```julia k = SqExponentialKernel() x1 = rand(3) x2 = rand(3) k(x1, x2) ``` -------------------------------- ### TransformedKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The TransformedKernel is a composite kernel that applies a transformation to the input data before applying a base kernel. ```APIDOC ## TransformedKernel ### Description The TransformedKernel is a composite kernel that applies a transformation to the input data before applying a base kernel. ### Constructor ```julia TransformedKernel(k::Kernel, t::Transform) ``` ``` -------------------------------- ### Define Complex Nested Kernels Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Shows how to construct a complex, nested kernel structure involving sums, products, and transformations. ```julia k = ( 0.5 * SqExponentialKernel() * Matern12Kernel() + 0.2 * (LinearKernel() ∘ ScaleTransform(2.0) + PolynomialKernel()) ) ∘ ARDTransform([0.1, 0.5]) ``` -------------------------------- ### Matern12Kernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The Matern12Kernel is a specific instance of the MaternKernel with ν=0.5, also known as the ExponentialKernel. ```APIDOC ## Matern12Kernel ### Description The Matern12Kernel is a specific instance of the MaternKernel with ν=0.5, also known as the ExponentialKernel. ### Constructor ```julia Matern12Kernel(l::Real=1.0, σ²::Real=1.0) ``` ``` -------------------------------- ### PiecewisePolynomialKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The PiecewisePolynomialKernel is a base kernel that uses piecewise polynomial functions. ```APIDOC ## PiecewisePolynomialKernel ### Description The PiecewisePolynomialKernel is a base kernel that uses piecewise polynomial functions. ### Constructor ```julia PiecewisePolynomialKernel(l::Real=1.0, σ²::Real=1.0, m::Int=1) ``` ``` -------------------------------- ### LinearMixingModelKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The LinearMixingModelKernel is a multi-output kernel that implements a linear mixing model for combining scalar kernels. ```APIDOC ## LinearMixingModelKernel ### Description The LinearMixingModelKernel is a multi-output kernel that implements a linear mixing model for combining scalar kernels. ### Constructor ```julia LinearMixingModelKernel(ks::Kernel, A::AbstractMatrix) ``` ``` -------------------------------- ### MOInput Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md A type representing inputs for multi-output Gaussian Processes. ```APIDOC ## Type: MOInput ### Description A type representing inputs for multi-output Gaussian Processes. An input is a tuple where the first element is the location in the domain and the second element is the output index. ### Usage `MOInput(location::T, output_index::Int)` where `T` is the type of the location. ### Parameters - **location** (T): The location in the domain. - **output_index** (Int): The index of the output this input corresponds to. ``` -------------------------------- ### ∘(::Kernel, ::Transform) Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The ∘ operator creates a TransformedKernel by composing a base kernel with a transformation. ```APIDOC ## ∘(::Kernel, ::Transform) ### Description The ∘ operator creates a TransformedKernel by composing a base kernel with a transformation. ### Usage ```julia k = SqExponentialKernel() ∘ ScaleTransform(2.0) ``` ``` -------------------------------- ### Multi-Output Input Type Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Represents a single input for a multi-output GP, consisting of a location and an output index. Enables specialized kernel computations. ```julia MOInput{T, N}(x::T, i::Int) ``` -------------------------------- ### Create Mahalanobis-like Kernel with LinearTransform Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Replaces the removed MahalanobisKernel by composing a Squared Exponential kernel with a LinearTransform of the inputs, effectively using a Mahalanobis distance. ```julia k = SqExponentialKernel() ∘ LinearTransform(sqrt(2) .* Q) ``` -------------------------------- ### Set Kernel Lengthscale with with_lengthscale Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md A convenience function to create a kernel with a specified lengthscale. This is equivalent to pre-composing with a ScaleTransform. ```julia k = with_lengthscale(SqExponentialKernel(), 0.5) ``` -------------------------------- ### LatentFactorMOKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The LatentFactorMOKernel is a multi-output kernel that models dependencies between output dimensions through latent factors. ```APIDOC ## LatentFactorMOKernel ### Description The LatentFactorMOKernel is a multi-output kernel that models dependencies between output dimensions through latent factors. ### Constructor ```julia LatentFactorMOKernel(k::Kernel, A::AbstractMatrix) ``` ``` -------------------------------- ### NormalizedKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The NormalizedKernel is a composite kernel that normalizes the output of a base kernel, typically to have unit variance. ```APIDOC ## NormalizedKernel ### Description The NormalizedKernel is a composite kernel that normalizes the output of a base kernel, typically to have unit variance. ### Constructor ```julia NormalizedKernel(k::Kernel) ``` ``` -------------------------------- ### Kronecker Kernel Matrix Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Computes the kernel matrix using Kronecker products. Requires Kronecker.jl. ```julia kronecker_kernelmatrix(k1::Kernel, k2::Kernel, x1::AbstractVector, x2::AbstractVector) ``` -------------------------------- ### Set Vector Lengthscales with ARDTransform and Composition Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Explicitly composes a Squared Exponential kernel with an ARDTransform using inverse lengthscales to achieve anisotropic behavior. ```julia k = SqExponentialKernel() ∘ ARDTransform(1 ./ length_scales) ``` -------------------------------- ### KernelSum Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The KernelSum is a composite kernel that represents the sum of multiple kernels. ```APIDOC ## KernelSum ### Description The KernelSum is a composite kernel that represents the sum of multiple kernels. ### Constructor ```julia KernelSum(ks::Kernel...) ``` ``` -------------------------------- ### kernelpdmat Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Computes a positive-definite matrix (PDMat) from a kernel. ```APIDOC ## Function: kernelpdmat ### Description Computes a positive-definite matrix (PDMat) from a kernel. This is useful for operations that require a PDMat, often in the context of Gaussian Processes or related statistical models. ### Method `kernelpdmat(k::Kernel, x)` ### Parameters - **k** (Kernel): The kernel function. - **x** (AbstractVector): The collection of inputs. ### Response Returns a PDMat object representing the kernel matrix. ``` -------------------------------- ### Set Vector Lengthscales with ARDTransform Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Uses with_lengthscale with a vector of lengthscales to configure a kernel for Anisotropic (ARD) transformations, equivalent to pre-composing with ARDTransform. ```julia length_scales = [1.0, 2.0] k = with_lengthscale(SqExponentialKernel(), length_scales) ``` -------------------------------- ### Wrap Vector-Valued Inputs with ColVecs Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Wraps a matrix of vector-valued inputs into a ColVecs type for efficient kernel computations. Recommended over Vector{Vector{<:Real}}. ```julia ColVecs(x::AbstractMatrix{<:Real}) ``` -------------------------------- ### with_lengthscale Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/transform.md Convenience function to create a transform with a specified lengthscale. ```APIDOC ## Function: with_lengthscale ### Description Convenience function to create a transform with a specified lengthscale. ### Usage `with_lengthscale(transform, lengthscale)` ``` -------------------------------- ### SqExponentialKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The SqExponentialKernel, also known as the Radial Basis Function (RBF) kernel, is a base kernel with a squared exponential decay. ```APIDOC ## SqExponentialKernel ### Description The SqExponentialKernel, also known as the Radial Basis Function (RBF) kernel, is a base kernel with a squared exponential decay. ### Constructor ```julia SqExponentialKernel(l::Real=1.0, σ²::Real=1.0) ``` ``` -------------------------------- ### Wrap Vector-Valued Inputs with RowVecs Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Wraps a matrix of vector-valued inputs into a RowVecs type for efficient kernel computations. Recommended over Vector{Vector{<:Real}}. ```julia RowVecs(x::AbstractMatrix{<:Real}) ``` -------------------------------- ### Set Kernel Lengthscale with compose Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Achieves the same result as using the composition operator (∘) by explicitly composing the kernel with a ScaleTransform. ```julia k = compose(SqExponentialKernel(), ScaleTransform(2.0)) ``` -------------------------------- ### kronecker_kernelmatrix Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Computes the kernel matrix using Kronecker products. ```APIDOC ## Function: kronecker_kernelmatrix ### Description Computes the kernel matrix using Kronecker products. This function is intended for use with kernels that are compatible with Kronecker operations, often involving multiple output dimensions. ### Method `kronecker_kernelmatrix(k::Kernel, x)` ### Parameters - **k** (Kernel): The kernel function, expected to be Kronecker-compatible. - **x** (AbstractVector): The collection of inputs. ### Response Returns the kernel matrix computed using Kronecker products. ``` -------------------------------- ### Define Custom Kernel with Functors.@functor Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/create_kernel.md Use Functors.@functor to specify trainable kernel parameters when all fields of the kernel struct are trainable. This is compatible with the Flux ML framework. ```julia import Functors struct MyKernel{T} <: KernelFunctions.Kernel a::Vector{T} end Functors.@functor MyKernel ``` -------------------------------- ### spectral_mixture_kernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The spectral_mixture_kernel is a base kernel that approximates other kernels by summing spectral densities. ```APIDOC ## spectral_mixture_kernel ### Description The spectral_mixture_kernel is a base kernel that approximates other kernels by summing spectral densities. ### Constructor ```julia spectral_mixture_kernel(l::AbstractVector{<:Real}, σ²::AbstractVector{<:Real}) ``` ``` -------------------------------- ### Nystrom Approximation Utility Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Utility function for Nystrom approximation. Used for approximating kernel matrices. ```julia nystrom(k::Kernel, x::AbstractVector, k_args...) ``` -------------------------------- ### Compute Kernel Matrix In-Place Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Computes the kernel matrix in-place for a given kernel and input data. Ensure inputs are AbstractVectors. ```julia kernelmatrix!(K::AbstractMatrix, k::Kernel, x::AbstractVector) ``` -------------------------------- ### Kernel Positive Definite Matrix Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Computes the kernel matrix as a positive definite matrix. Requires PDMats.jl. ```julia kernelpdmat(k::Kernel, x::AbstractVector) ``` -------------------------------- ### kernelkronmat Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Computes the kernel matrix for Kronecker product kernels. ```APIDOC ## Function: kernelkronmat ### Description Computes the kernel matrix for Kronecker product kernels. This function is specifically designed for kernels structured as Kronecker products. ### Method `kernelkronmat(k::Kernel, x)` ### Parameters - **k** (Kernel): The Kronecker product kernel. - **x** (AbstractVector): The collection of inputs. ### Response Returns the kernel matrix for the Kronecker product kernel. ``` -------------------------------- ### Define Custom Kernel with Explicit Functor Reconstruction Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/create_kernel.md Implement `Functors.functor` explicitly for custom reconstruction when only a subset of kernel fields are trainable. This allows specifying which parameters are modified. ```julia import Functors struct MyKernel{T} <: KernelFunctions.Kernel n::Int a::Vector{T} end function Functors.functor(::Type{<:MyKernel}, x::MyKernel) function reconstruct_mykernel(xs) # keep field `n` of the original kernel and set `a` to (possibly different) `xs.a` return MyKernel(x.n, xs.a) end return (a = x.a,), reconstruct_mykernel end ``` -------------------------------- ### PeriodicTransform Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/transform.md Applies a periodic transformation to the input data. ```APIDOC ## Type: PeriodicTransform ### Description Applies a periodic transformation to the input data. ### Constructor `PeriodicTransform(transform::Transform, period::Real)` ### Methods - `t(x)`: Applies the periodic transformation to `x`. - `map(t, xs)`: Applies the periodic transformation to `xs`. ``` -------------------------------- ### FunctionTransform Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/transform.md Applies a given function to each element of the input data. ```APIDOC ## Type: FunctionTransform ### Description Applies a given function to each element of the input data. ### Constructor `FunctionTransform(func::Function)` ### Methods - `t(x)`: Returns `func(x)`. - `map(t, xs)`: Returns `map(func, xs)`. ``` -------------------------------- ### KernelProduct Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The KernelProduct is a composite kernel that represents the product of multiple kernels. ```APIDOC ## KernelProduct ### Description The KernelProduct is a composite kernel that represents the product of multiple kernels. ### Constructor ```julia KernelProduct(ks::Kernel...) ``` ``` -------------------------------- ### Kernel Kronecker Product Matrix Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Computes the kernel matrix as a Kronecker product of two kernel matrices. Requires Kronecker.jl. ```julia kernelkronmat(k1::Kernel, k2::Kernel, x::AbstractVector) ``` -------------------------------- ### Transform Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/transform.md Abstract type for input transformations. Represents the base for all transform objects. ```APIDOC ## Type: Transform ### Description Abstract type for input transformations. Represents the base for all transform objects. ### Methods - `t(x)`: Apply transform `t` to a single input `x`. - `map(t, xs)`: Apply transform `t` to multiple inputs `xs`. ``` -------------------------------- ### MaternKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The MaternKernel is a base kernel that provides a flexible family of stationary covariance functions, parameterized by ν. ```APIDOC ## MaternKernel ### Description The MaternKernel is a base kernel that provides a flexible family of stationary covariance functions, parameterized by ν. ### Constructor ```julia MaternKernel(ν::Real=2.5, l::Real=1.0, σ²::Real=1.0) ``` ``` -------------------------------- ### Specify Metric for a Custom Kernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/metrics.md Define the metric used by a custom kernel type by implementing the `metric` function. ```julia KernelFunctions.metric(::CustomKernel) = SqEuclidean() ``` -------------------------------- ### ARDTransform Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/transform.md Applies Automatic Relevance Determination (ARD) scaling to input data using a vector. ```APIDOC ## Type: ARDTransform ### Description Applies Automatic Relevance Determination (ARD) scaling to input data using a vector. ### Constructor `ARDTransform(vector::AbstractVector)` ### Methods - `t(x)`: Returns `vector .* x`. - `map(t, xs)`: Returns `vector .* xs`. ``` -------------------------------- ### kernelmatrix Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Computes the kernel matrix for a given kernel and collection of inputs. This is a core function for Gaussian Process computations. ```APIDOC ## Function: kernelmatrix ### Description Computes the kernel matrix for a given kernel and collection of inputs. This is a core function for Gaussian Process computations. ### Method `kernelmatrix(k::Kernel, x)` ### Parameters - **k** (Kernel): The kernel function to use. - **x** (AbstractVector): A collection of inputs. For univariate inputs, this can be an `AbstractVector{<:Real}`. For vector-valued inputs, it is recommended to use `ColVecs` or `RowVecs`. ### Response Returns a matrix representing the kernel matrix. ``` -------------------------------- ### RBFKernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The RBFKernel is an alias for the Radial Basis Function Kernel (SqExponentialKernel), a widely used base kernel. ```APIDOC ## RBFKernel ### Description The RBFKernel is an alias for the Radial Basis Function Kernel (SqExponentialKernel), a widely used base kernel. ### Constructor ```julia RBFKernel(l::Real=1.0, σ²::Real=1.0) ``` ``` -------------------------------- ### ScaleTransform Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/transform.md Scales the input data by a scalar value. ```APIDOC ## Type: ScaleTransform ### Description Scales the input data by a scalar value. ### Constructor `ScaleTransform(scalar::Real)` ### Methods - `t(x)`: Returns `scalar * x`. - `map(t, xs)`: Returns `scalar .* xs`. ``` -------------------------------- ### spectral_mixture_product_kernel Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The spectral_mixture_product_kernel is a composite kernel that computes the product of spectral mixture kernels. ```APIDOC ## spectral_mixture_product_kernel ### Description The spectral_mixture_product_kernel is a composite kernel that computes the product of spectral mixture kernels. ### Constructor ```julia spectral_mixture_product_kernel(l::AbstractVector{<:Real}, σ²::AbstractVector{<:Real}) ``` ``` -------------------------------- ### Compute Kernel Matrix Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Computes the kernel matrix for a given kernel and input data. Ensure inputs are AbstractVectors. ```julia kernelmatrix(k::Kernel, x::AbstractVector) ``` -------------------------------- ### Set Kernel Lengthscale with ScaleTransform Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/userguide.md Applies a scale transform to a Squared Exponential kernel to set a specific lengthscale. The transform multiplies the input by a factor, which is the inverse of the lengthscale. ```julia k = SqExponentialKernel() ∘ ScaleTransform(2.0) ``` -------------------------------- ### median_heuristic_transform Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/transform.md Convenience function to determine a transform using the median heuristic. ```APIDOC ## Function: median_heuristic_transform ### Description Convenience function to determine a transform using the median heuristic. ### Usage `median_heuristic_transform(kernel, data)` ``` -------------------------------- ### Compute Diagonal of Kernel Matrix In-Place Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Computes the diagonal elements of the kernel matrix in-place. Ensure inputs are AbstractVectors. ```julia kernelmatrix_diag!(d::AbstractVector, k::Kernel, x::AbstractVector) ``` -------------------------------- ### KernelTensorProduct Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/kernels.md The KernelTensorProduct is a composite kernel that computes the tensor product of multiple kernels, often used for multi-dimensional inputs. ```APIDOC ## KernelTensorProduct ### Description The KernelTensorProduct is a composite kernel that computes the tensor product of multiple kernels, often used for multi-dimensional inputs. ### Constructor ```julia KernelTensorProduct(ks::Kernel...) ``` ``` -------------------------------- ### kernelmatrix! Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Computes the kernel matrix in-place for a given kernel and collection of inputs. This function modifies the provided matrix. ```APIDOC ## Function: kernelmatrix! ### Description Computes the kernel matrix in-place for a given kernel and collection of inputs. This function modifies the provided matrix. ### Method `kernelmatrix!(K::AbstractMatrix, k::Kernel, x)` ### Parameters - **K** (AbstractMatrix): The matrix to be filled with the kernel matrix. - **k** (Kernel): The kernel function to use. - **x** (AbstractVector): A collection of inputs. For univariate inputs, this can be an `AbstractVector{<:Real}`. For vector-valued inputs, it is recommended to use `ColVecs` or `RowVecs`. ### Response Returns the modified matrix `K` containing the kernel matrix. ``` -------------------------------- ### IdentityTransform Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/transform.md A transform that returns the input data unchanged. ```APIDOC ## Type: IdentityTransform ### Description A transform that returns the input data unchanged. ### Methods - `t(x)`: Returns `x`. - `map(t, xs)`: Returns `xs`. ``` -------------------------------- ### ColVecs Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md A wrapper type for collections of vector-valued inputs stored as columns of a matrix. Recommended for performance. ```APIDOC ## Type: ColVecs ### Description A wrapper type for collections of vector-valued inputs stored as columns of a matrix. This representation is recommended for performance when computing kernel matrices, as it allows for optimized matrix-matrix multiplication. ### Usage `ColVecs(matrix::AbstractMatrix{<:Real})` ### Parameters - **matrix** (AbstractMatrix{<:Real}): A matrix where each column represents a vector-valued input. ``` -------------------------------- ### RowVecs Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md A wrapper type for collections of vector-valued inputs stored as rows of a matrix. Recommended for performance. ```APIDOC ## Type: RowVecs ### Description A wrapper type for collections of vector-valued inputs stored as rows of a matrix. This representation is recommended for performance when computing kernel matrices, as it allows for optimized matrix-matrix multiplication. ### Usage `RowVecs(matrix::AbstractMatrix{<:Real})` ### Parameters - **matrix** (AbstractMatrix{<:Real}): A matrix where each row represents a vector-valued input. ``` -------------------------------- ### Compute Diagonal of Kernel Matrix Source: https://github.com/juliagaussianprocesses/kernelfunctions.jl/blob/master/docs/src/api.md Computes the diagonal elements of the kernel matrix. Ensure inputs are AbstractVectors. ```julia kernelmatrix_diag(k::Kernel, x::AbstractVector) ```