API Library


Functions

KernelFunctions.kernelmatrixFunction
kernelmatrix(κ::Kernel, X; obsdim::Int = 2)
kernelmatrix(κ::Kernel, X, Y; obsdim::Int = 2)

Calculate the kernel matrix of X (and Y) with respect to kernel κ. obsdim = 1 means the matrix X (and Y) has size #samples x #dimension obsdim = 2 means the matrix X (and Y) has size #dimension x #samples

source
KernelFunctions.kernelmatrix!Function
kernelmatrix!(K::AbstractMatrix, κ::Kernel, X; obsdim::Integer = 2)
kernelmatrix!(K::AbstractMatrix, κ::Kernel, X, Y; obsdim::Integer = 2)

In-place version of kernelmatrix where pre-allocated matrix K will be overwritten with the kernel matrix.

source
KernelFunctions.kernelmatrix_diagFunction
kernelmatrix_diag(κ::Kernel, X; obsdim::Int = 2)

Calculate the diagonal matrix of X with respect to kernel κ obsdim = 1 means the matrix X has size #samples x #dimension obsdim = 2 means the matrix X has size #dimension x #samples

kernelmatrix_diag(κ::Kernel, X, Y; obsdim::Int = 2)

Calculate the diagonal of kernelmatrix(κ, X, Y; obsdim) efficiently. Requires that X and Y are the same length.

source
KernelFunctions.kernelpdmatFunction
kernelpdmat(k::Kernel, X::AbstractMatrix; obsdim::Int=2)
kernelpdmat(k::Kernel, X::AbstractVector)

Compute a positive-definite matrix in the form of a PDMat matrix see PDMats.jl with the cholesky decomposition precomputed. The algorithm recursively tries to add recursively a diagonal nugget until positive definiteness is achieved or until the noise is too big.

source
KernelFunctions.nystromFunction
nystrom(k::Kernel, X::Matrix, S::Vector; obsdim::Int=defaultobs)

Computes a factorization of Nystrom approximation of the square kernel matrix of data matrix X with respect to kernel k. Returns a NystromFact struct which stores a Nystrom factorization satisfying:

\[\mathbf{K} \approx \mathbf{C}^{\intercal}\mathbf{W}\mathbf{C}\]

source
nystrom(k::Kernel, X::Matrix, r::Real; obsdim::Int=defaultobs)

Computes a factorization of Nystrom approximation of the square kernel matrix of data matrix X with respect to kernel k using a sample ratio of r. Returns a NystromFact struct which stores a Nystrom factorization satisfying:

\[\mathbf{K} \approx \mathbf{C}^{\intercal}\mathbf{W}\mathbf{C}\]

source

Utilities

KernelFunctions.ColVecsType
ColVecs(X::AbstractMatrix)

A lightweight wrapper for an AbstractMatrix to make it behave like a vector of vectors. Each vector represents a column of the matrix

source
KernelFunctions.RowVecsType
RowVecs(X::AbstractMatrix)

A lightweight wrapper for an AbstractMatrix to make it behave like a vector of vectors. Each vector represents a row of the matrix

source
KernelFunctions.MOInputType
MOInput(x::AbstractVector, out_dim::Integer)

A data type to accomodate modelling multi-dimensional output data.

source
KernelFunctions.NystromFactType
NystromFact

Type for storing a Nystrom factorization. The factorization contains two fields: W and C, two matrices satisfying:

\[\mathbf{K} \approx \mathbf{C}^{\intercal}\mathbf{W}\mathbf{C}\]

source

Index