Package smile.math.kernel
Class SumKernel<T>
java.lang.Object
smile.math.kernel.SumKernel<T>
- Type Parameters:
T
- the input type of kernel function.
- All Implemented Interfaces:
Serializable
,ToDoubleBiFunction<T,
,T> MercerKernel<T>
The sum kernel takes two kernels and combines them via k1(x, y) + k2(x, y)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble[]
hi()
Returns the upper bound of hyperparameters (in hyperparameter tuning).double[]
Returns the hyperparameters of kernel.double
Kernel function.double[]
Computes the kernel and its gradient over hyperparameters.double[]
lo()
Returns the lower bound of hyperparameters (in hyperparameter tuning).of
(double[] params) Returns the same kind kernel with the new hyperparameters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface smile.math.kernel.MercerKernel
apply, applyAsDouble, K, K, KG
-
Constructor Details
-
SumKernel
Constructor.- Parameters:
k1
- the kernel to combine.k2
- the kernel to combine.
-
-
Method Details
-
k
Description copied from interface:MercerKernel
Kernel function.- Specified by:
k
in interfaceMercerKernel<T>
- Parameters:
x
- an object.y
- an object.- Returns:
- the kernel value.
-
kg
Description copied from interface:MercerKernel
Computes the kernel and its gradient over hyperparameters.- Specified by:
kg
in interfaceMercerKernel<T>
- Parameters:
x
- an object.y
- an object.- Returns:
- the kernel value and gradient.
-
of
Description copied from interface:MercerKernel
Returns the same kind kernel with the new hyperparameters.- Specified by:
of
in interfaceMercerKernel<T>
- Parameters:
params
- the hyperparameters.- Returns:
- the same kind kernel with the new hyperparameters.
-
hyperparameters
public double[] hyperparameters()Description copied from interface:MercerKernel
Returns the hyperparameters of kernel.- Specified by:
hyperparameters
in interfaceMercerKernel<T>
- Returns:
- the hyperparameters of kernel.
-
lo
public double[] lo()Description copied from interface:MercerKernel
Returns the lower bound of hyperparameters (in hyperparameter tuning).- Specified by:
lo
in interfaceMercerKernel<T>
- Returns:
- the lower bound of hyperparameters.
-
hi
public double[] hi()Description copied from interface:MercerKernel
Returns the upper bound of hyperparameters (in hyperparameter tuning).- Specified by:
hi
in interfaceMercerKernel<T>
- Returns:
- the upper bound of hyperparameters.
-