|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.sandia.cognition.util.AbstractCloneableSerializable
gov.sandia.cognition.learning.function.kernel.DefaultKernelContainer<InputType>
gov.sandia.cognition.learning.function.kernel.WeightedKernel<InputType>
InputType
- The type of the input to the Kernel. For example, Vector.@CodeReview(reviewer="Kevin R. Dixon", date="2009-07-08", changesNeeded=false, comments={"Made clone call super.clone.","Now implements Weighted interface.","Looks fine otherwise."}) public class WeightedKernel<InputType>
The WeightedKernel
class implements a kernel that takes another
kernel, evaluates it, and then the result is rescaled by a given weight.
Field Summary | |
---|---|
static double |
DEFAULT_WEIGHT
The default weight is 1.0. |
protected double |
weight
The weight on the kernel. |
Fields inherited from class gov.sandia.cognition.learning.function.kernel.DefaultKernelContainer |
---|
kernel |
Constructor Summary | |
---|---|
WeightedKernel()
Creates a new instance of WeightedKernel with a default weight of 1.0 and a null kernel. |
|
WeightedKernel(double weight,
Kernel<? super InputType> kernel)
Creates a new instance of WeightedKernel from the given weight and kernel. |
Method Summary | |
---|---|
WeightedKernel<InputType> |
clone()
Creates a copy of this kernel. |
double |
evaluate(InputType x,
InputType y)
The weighted kernel just passes the kernel evaluation to its own internal kernel and then multiplies it by the weight. |
double |
getWeight()
Gets the weight used to rescale the kernel's results. |
void |
setWeight(double weight)
Sets the weight used to rescale the kernel's results. |
Methods inherited from class gov.sandia.cognition.learning.function.kernel.DefaultKernelContainer |
---|
getKernel, setKernel |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double DEFAULT_WEIGHT
protected double weight
Constructor Detail |
---|
public WeightedKernel()
public WeightedKernel(double weight, Kernel<? super InputType> kernel)
weight
- The weight to apply to the kernel. Must be non-negative.kernel
- The actual kernel to evaluate.Method Detail |
---|
public WeightedKernel<InputType> clone()
clone
in interface CloneableSerializable
clone
in class DefaultKernelContainer<InputType>
public double evaluate(InputType x, InputType y)
evaluate
in interface Kernel<InputType>
x
- The first item.y
- The second item.
public double getWeight()
getWeight
in interface Weighted
public void setWeight(double weight)
weight
- The kernel's weight. Must be non-negative.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |