public class HyperbolicTangentKernel extends Object implements KernelFunction, Serializable
HyperbolicTangentKernel provides a kernel based on
the hyperbolic tangent of a dot product with fixed linear scaling.
Hyperbolic tangent kernels are popular as neural network activation
functions.
The hyperbolic tangent kernel function of with parameters
k0 and k1 is defined between two
vectors v1 and v2 of the same
dimensionality by:
wherekernel(v1,v2) = tanh(k1 * v1 * v2 + k0)
v1 * v2 is the usual dot product and
the constant k1 is simply a scalar multiplier.
| Constructor and Description |
|---|
HyperbolicTangentKernel(double k0,
double k1)
Construct a linearly offset hyperbolic tangent kernel
with the specified slope and intercept parameters.
|
| Modifier and Type | Method and Description |
|---|---|
double |
proximity(Vector v1,
Vector v2)
Returns the result of applying the hyperbolic tangent kernel
function to to the specified vectors.
|
String |
toString()
Returns a string-based representation of this kernel
function, including the offset and slope parameters.
|
public HyperbolicTangentKernel(double k0,
double k1)
k0 - Intercept parameter.k1 - Slope parameter.IllegalArgumentException - If either of the parameters
are not finite numbers, or if the k1 parameter is zero.public double proximity(Vector v1, Vector v2)
proximity in interface KernelFunctionproximity in interface Proximity<Vector>v1 - First vector.v2 - Second vector.IllegalArgumentException - If the vectors are not of the
same dimensionality.Copyright © 2016 Alias-i, Inc.. All rights reserved.