public class SigmoidKernel extends Kernel implements Serializable, Cloneable
The kernel function at two data nodes, \(x_i\) and \(x_j\), is given by \(K(x_i , x_j) = \text{tanh}( \gamma x_i^T x_j + r)\) where \(\gamma\) and r are configurable parameters.
Constructor and Description |
---|
SigmoidKernel()
Constructor for the sigmoid kernel.
|
SigmoidKernel(double gamma,
double r)
Constructs a sigmoid kernel.
|
SigmoidKernel(SigmoidKernel sigmoidKernel)
Constructs a copy of the input
SigmoidKernel kernel. |
Modifier and Type | Method and Description |
---|---|
SigmoidKernel |
clone()
Clones a
SigmoidKernel kernel. |
double |
kernelFunction(DataNode[][] x,
int i,
int j)
Calculates the kernel function between two
DataNode s. |
double |
kernelFunction(DataNode[] x,
DataNode[] y)
Calculates the kernel function between two
DataNode s. |
void |
setParameters(double... kParams)
Sets the parameters for the sigmoid kernel.
|
dot, getParameters
public SigmoidKernel()
The default values for the sigmoid kernel are
\(\gamma\)=1.0 and r
=0.0.
public SigmoidKernel(double gamma, double r)
gamma
- a double
, the sigmoid kernel slope
parameterr
- a double
, the function intercept parameterpublic SigmoidKernel(SigmoidKernel sigmoidKernel)
SigmoidKernel
kernel.sigmoidKernel
- a SigmoidKernel
kernelpublic SigmoidKernel clone()
SigmoidKernel
kernel.public void setParameters(double... kParams)
setParameters
in class Kernel
kParams
- a double
array of length 2 containing
parameter values: kParams[0]
=\(\gamma\)
and kParams[1]
=r
Default: kParams[0]
=\(\gamma\)=1.0 and
kParams[1]
=r=0
public double kernelFunction(DataNode[] x, DataNode[] y)
DataNode
s.kernelFunction
in class Kernel
x
- a DataNode
arrayy
- a DataNode
arraydouble
, the kernel function evaluated at
x
and y
public double kernelFunction(DataNode[][] x, int i, int j)
DataNode
s.kernelFunction
in class Kernel
x
- a DataNode
matrixi
- an int
, index to the first DataNode
,
x[i]
j
- an int
, index to the second DataNode
,
x[j]
double
, the kernel function evaluated at
x[i]
and x[j]
Copyright © 2020 Rogue Wave Software. All rights reserved.