Arccosine
ArcCosine
ArcCosine(
active_dims=None,
order=0,
variance=1.0,
weight_variance=1.0,
bias_variance=1.0,
n_dims=None,
compute_engine=DenseKernelComputation(),
)
Bases: AbstractKernel
The ArCosine kernel.
This kernel is non-stationary and resembles the behavior of neural networks. See Section 3.1 of Cho and Saul (2011) for additional details.
Parameters:
-
active_dims(Union[list[int], slice, None], default:None) βThe indices of the input dimensions that the kernel operates on.
-
order(Literal[0, 1, 2], default:0) βThe order of the kernel. Must be 0, 1 or 2.
-
variance(Union[ScalarFloat, Variable[ScalarArray]], default:1.0) βThe variance of the kernel Ο.
-
weight_variance(Union[WeightVarianceCompatible, Variable[WeightVariance]], default:1.0) βThe weight variance of the kernel.
-
bias_variance(Union[ScalarFloat, Variable[ScalarArray]], default:1.0) βThe bias variance of the kernel.
-
n_dims(Union[int, None], default:None) βThe number of input dimensions. If
lengthscaleis an array, this argument is ignored. -
compute_engine(AbstractKernelComputation, default:DenseKernelComputation()) βThe computation engine that the kernel uses to compute the covariance matrix.
cross_covariance
Compute the cross-covariance matrix of the kernel.
Parameters:
-
x(Num[Array, 'N D']) βthe first input matrix of shape
(N, D). -
y(Num[Array, 'M D']) βthe second input matrix of shape
(M, D).
Returns:
-
Float[Array, 'N M']βThe cross-covariance matrix of the kernel of shape
(N, M).
gram
Compute the gram matrix of the kernel.
Parameters:
-
x(Num[Array, 'N D']) βthe input matrix of shape
(N, D).
Returns:
-
LinearOperatorβThe gram matrix of the kernel of shape
(N, N).
diagonal
Compute the diagonal of the gram matrix of the kernel.
Parameters:
-
x(Num[Array, 'N D']) βthe input matrix of shape
(N, D).
Returns:
-
Float[Array, ' N']βThe diagonal of the gram matrix of the kernel of shape
(N,).
slice_input
Slice out the relevant columns of the input matrix.
Select the relevant columns of the supplied matrix to be used within the kernel's evaluation.
Parameters:
-
x(Float[Array, '... D']) βthe matrix or vector that is to be sliced.
Returns:
-
Float[Array, '... Q']βThe sliced form of the input matrix.
__add__
Add two kernels together. Args: other (AbstractKernel): The kernel to be added to the current kernel.
Returns:
-
AbstractKernel(AbstractKernel) βA new kernel that is the sum of the two kernels.
__mul__
Multiply two kernels together.
Parameters:
-
other(AbstractKernel) βThe kernel to be multiplied with the current kernel.
Returns:
-
AbstractKernel(AbstractKernel) βA new kernel that is the product of the two kernels.