public class BinarySparseGaussianKernel extends Gaussian implements MercerKernel<int[]>
k(u, v) = e-||u-v||2 / (2 * σ2)
where σ > 0 is the scale parameter of the kernel. The kernel works
on sparse binary array as int[], which are the indices of nonzero elements.
The Gaussian kernel is a good choice for a great deal of applications, although sometimes it is remarked as being overused.
| Constructor and Description |
|---|
BinarySparseGaussianKernel(double sigma)
Constructor.
|
BinarySparseGaussianKernel(double sigma,
double lo,
double hi)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double[] |
hi()
Returns the upper bound of hyperparameters.
|
double[] |
hyperparameters()
Returns the hyperparameters for tuning.
|
double |
k(int[] x,
int[] y)
Kernel function.
|
double[] |
kg(int[] x,
int[] y)
Computes the kernel and its gradient over hyperparameters.
|
double[] |
lo()
Returns the lower bound of hyperparameters.
|
BinarySparseGaussianKernel |
of(double[] params)
Returns the same kind kernel with the new hyperparameters.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapply, applyAsDouble, K, K, KGapply, f, K, KGpublic BinarySparseGaussianKernel(double sigma)
sigma - The length scale of kernel.public BinarySparseGaussianKernel(double sigma,
double lo,
double hi)
sigma - The length scale of kernel.lo - The lower bound of length scale for hyperparameter tuning.hi - The upper bound of length scale for hyperparameter tuning.public double k(int[] x,
int[] y)
MercerKernelk in interface MercerKernel<int[]>public double[] kg(int[] x,
int[] y)
MercerKernelkg in interface MercerKernel<int[]>public BinarySparseGaussianKernel of(double[] params)
MercerKernelof in interface MercerKernel<int[]>public double[] hyperparameters()
MercerKernelhyperparameters in interface MercerKernel<int[]>public double[] lo()
MercerKernello in interface MercerKernel<int[]>public double[] hi()
MercerKernelhi in interface MercerKernel<int[]>