gov.sandia.cognition.learning.function.vector
Class VectorizableVectorConverterWithBias

java.lang.Object
  extended by gov.sandia.cognition.learning.function.vector.VectorizableVectorConverter
      extended by gov.sandia.cognition.learning.function.vector.VectorizableVectorConverterWithBias
All Implemented Interfaces:
Evaluator<Vectorizable,Vector>, VectorFactoryContainer, CloneableSerializable, Serializable, Cloneable

public class VectorizableVectorConverterWithBias
extends VectorizableVectorConverter
implements VectorFactoryContainer

The VectorizableVectorConverterWithBias class extends the VectorizableVectorConverter class to append a constant bias value of 1.0 to the vector returned by the converter.

Since:
2.0
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
protected  VectorFactory<?> vectorFactory
          The factory used to create the vector.
 
Constructor Summary
VectorizableVectorConverterWithBias()
          Creates a new instance of VectorizableVectorConverterWithBias.
VectorizableVectorConverterWithBias(VectorFactory<?> vectorFactory)
          Creates a new instance of VectorizableVectorConverterWithBias.
 
Method Summary
 VectorizableVectorConverterWithBias clone()
          Creates a new clone (shallow copy) of this object.
 Vector evaluate(Vectorizable input)
          Evaluates the given vectorizable input by converting it to a vector and then creating a new vector of one extra dimensionality and adding a single element with bias 1.0 to the end.
 VectorFactory<?> getVectorFactory()
          Gets the vector factory used to create the vector with the bias.
 void setVectorFactory(VectorFactory<?> vectorFactory)
          Sets the vector factory used to create the vector with the bias.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vectorFactory

protected VectorFactory<?> vectorFactory
The factory used to create the vector.

Constructor Detail

VectorizableVectorConverterWithBias

public VectorizableVectorConverterWithBias()
Creates a new instance of VectorizableVectorConverterWithBias. It uses the default vector factory.


VectorizableVectorConverterWithBias

public VectorizableVectorConverterWithBias(VectorFactory<?> vectorFactory)
Creates a new instance of VectorizableVectorConverterWithBias.

Parameters:
vectorFactory - The vector factory to use.
Method Detail

clone

public VectorizableVectorConverterWithBias clone()
Creates a new clone (shallow copy) of this object.

Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class VectorizableVectorConverter
Returns:
A new clone (shallow copy) of this object.

evaluate

public Vector evaluate(Vectorizable input)
Evaluates the given vectorizable input by converting it to a vector and then creating a new vector of one extra dimensionality and adding a single element with bias 1.0 to the end.

Specified by:
evaluate in interface Evaluator<Vectorizable,Vector>
Overrides:
evaluate in class VectorizableVectorConverter
Parameters:
input - The input to evaluate.
Returns:
The vector version of the input with a constant bias term added.

getVectorFactory

public VectorFactory<?> getVectorFactory()
Gets the vector factory used to create the vector with the bias.

Specified by:
getVectorFactory in interface VectorFactoryContainer
Returns:
The vector factory used to create the vector with the bias.

setVectorFactory

public void setVectorFactory(VectorFactory<?> vectorFactory)
Sets the vector factory used to create the vector with the bias.

Parameters:
vectorFactory - The vector factory used to create the vector with the bias.