|
||||||||||
| 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.data.convert.AbstractDataConverter<InputType,Vector>
gov.sandia.cognition.data.convert.vector.AbstractToVectorEncoder<InputType>
gov.sandia.cognition.data.convert.vector.UniqueBooleanVectorEncoder<InputType>
InputType - The input type to encode as a unique values in a Vector.public class UniqueBooleanVectorEncoder<InputType>
An encoder for arbitrary objects that encodes an equality comparison between a given input and a set of unique values. It does an equality comparison to each specified value and encodes those booleans using a given boolean encoding. Typically, this encoding uses a single dimension for each value, but it supports boolean encodings of higher dimensionalities. This encoding is sometimes refered to as a "grandmother" encoding for neural networks, after the idea that there is a single neuron for each concept, such as your grandmother. The encoding is called a unique encoding because if a given input is in the set of possible values, a single true value will be encoded.
| Field Summary | |
|---|---|
protected DataToVectorEncoder<Boolean> |
booleanConverter
The boolean encoder for the equality comparison between each of the possible values and a given input. |
protected List<InputType> |
values
The set of possible unique values. |
| Fields inherited from class gov.sandia.cognition.data.convert.vector.AbstractToVectorEncoder |
|---|
vectorFactory |
| Constructor Summary | |
|---|---|
UniqueBooleanVectorEncoder(List<InputType> values,
DataToVectorEncoder<Boolean> booleanConverter)
Creates a new UniqueBooleanVectorEncoder. |
|
| Method Summary | |
|---|---|
void |
encode(InputType object,
Vector vector,
int startIndex)
Encodes the given object into the given vector at the given starting index by using a unique boolean encoding, where the given input value is compared to each of the encoder's values using equality. |
DataToVectorEncoder<Boolean> |
getBooleanConverter()
Gets the boolean converter used to encode the equality comparison between each of the unique values and a given input. |
int |
getOutputDimensionality()
Gets the dimensionality of the vector created by this converter, which is the number of possible values times the size of the boolean encoding. |
List<InputType> |
getValues()
Gets the list of unique values that the encoder is to use. |
protected void |
setBooleanConverter(DataToVectorEncoder<Boolean> booleanConverter)
Sets the boolean converter used to encode the equality comparison between each of the unique values and a given input. |
protected void |
setValues(List<InputType> values)
Sets the list of unique values that the encoder is to use. |
| Methods inherited from class gov.sandia.cognition.data.convert.vector.AbstractToVectorEncoder |
|---|
encode, evaluate |
| Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable |
|---|
clone |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected List<InputType> values
protected DataToVectorEncoder<Boolean> booleanConverter
| Constructor Detail |
|---|
public UniqueBooleanVectorEncoder(List<InputType> values,
DataToVectorEncoder<Boolean> booleanConverter)
UniqueBooleanVectorEncoder.
values - The list of possible values.booleanConverter - The boolean converter for the values.| Method Detail |
|---|
public void encode(InputType object,
Vector vector,
int startIndex)
object - The object to encode.vector - The vector to encode into.startIndex - The index to start the encoding at.public int getOutputDimensionality()
public List<InputType> getValues()
protected void setValues(List<InputType> values)
values - The list of unique values.public DataToVectorEncoder<Boolean> getBooleanConverter()
protected void setBooleanConverter(DataToVectorEncoder<Boolean> booleanConverter)
booleanConverter - The boolean converter to use.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||