|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclarion.system.AbstractImplicitModule
clarion.system.AbstractTrainableImplicitModule
clarion.system.AbstractRuntimeTrainableImplicitModule
clarion.system.TableLookup
public class TableLookup
This class implements a table lookup within CLARION. It extends the AbstractRuntimeTrainableImplicitModule class.
Usage:
A table lookup is the simplest form of implicit module that can be used in the bottom level of the CLARION subsystems. It consists of a hash map that uses dimension-value collections as keys and output chunk collections as values. The keys of the hash map are configurations of the input layer that are compared to the current input and the values of the hash map are output chunks that correspond to the chunks on the output layer.
When the forwardPass method is called, the table lookup takes the current input and compares it to the keys of the hash map until it finds a match. If no match is found, the forwardPass method does nothing. When a match is found, the method sets the activations of the output chunks of the table lookup to the activations of the output chunks contained within the collection located at the slot in the hash map whose key matched the current input.
This class is considered to be runtime trainable in that a value can be specified by the feedback for a chosen output chunk and that value will then be set as the new activation for that output chunk within the collection of output chunks located at the slot in the hash map whose key matched the current input. This procedure is performed during by the backwardPass method.
This class contains both global (static) and local constants. The default is to use the local constants. If you want to change any of the global constants, you need to do so before any instances of this class are initialized.
Field Summary | |
---|---|
protected double |
Feedback
The immediate feedback given (if given). |
static double |
GLOBAL_POSITIVE_MATCH_THRESHOLD
The threshold for the positive match criterion. |
private java.util.HashMap<DimensionValueCollection,AbstractOutputChunkCollection<? extends AbstractOutputChunk>> |
LookupTable
The hash map backed table lookup. |
protected double |
NM
The negative match counter. |
protected double |
PM
The positive match counter. |
double |
POSITIVE_MATCH_THRESHOLD
The threshold for the positive match criterion. |
Fields inherited from class clarion.system.AbstractTrainableImplicitModule |
---|
DesiredOutput |
Fields inherited from class clarion.system.AbstractImplicitModule |
---|
ACTUATION_TIME, ChosenOutput, DECISION_TIME, GLOBAL_ACTUATION_TIME, GLOBAL_DECISION_TIME, GLOBAL_PERCEPTION_TIME, InputAsCollection, Output, PERCEPTION_TIME |
Constructor Summary | |
---|---|
TableLookup(java.util.Collection<Dimension> InputSpace,
AbstractOutputChunkCollection<? extends AbstractOutputChunk> Outputs,
java.util.Map<DimensionValueCollection,AbstractOutputChunkCollection<? extends AbstractOutputChunk>> Table)
Initializes the table lookup with the input space, outputs, and map specified. |
Method Summary | |
---|---|
void |
backwardPass()
Updates the table lookup table given the chosen action and the feedback. |
boolean |
checkMatchCriterion()
Checks to see if the positive match criterion is satisfied given the immediate feedback received. |
void |
forwardPass()
Calculates the output activations based on the current input. |
java.lang.Double |
getSuccessRate()
Gets the success rate. |
Methods inherited from class clarion.system.AbstractRuntimeTrainableImplicitModule |
---|
getFeedback, getNM, getPM, incrementNM, incrementPM, resetMatchStatistics, setFeedback, setNM, setPM, updateMatchStatistics |
Methods inherited from class clarion.system.AbstractTrainableImplicitModule |
---|
getSumSqErrors, setDesiredOutput, setDesiredOutput |
Methods inherited from class clarion.system.AbstractImplicitModule |
---|
getChosenOutput, getInput, getNumInput, getNumOutput, getOutput, getOutput, getResponseTime, setChosenOutput, setInput, setInput, setInput |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface clarion.system.InterfaceTrainable |
---|
getSumSqErrors, setDesiredOutput, setDesiredOutput |
Field Detail |
---|
private java.util.HashMap<DimensionValueCollection,AbstractOutputChunkCollection<? extends AbstractOutputChunk>> LookupTable
protected double Feedback
protected double PM
protected double NM
public static double GLOBAL_POSITIVE_MATCH_THRESHOLD
public double POSITIVE_MATCH_THRESHOLD
Constructor Detail |
---|
public TableLookup(java.util.Collection<Dimension> InputSpace, AbstractOutputChunkCollection<? extends AbstractOutputChunk> Outputs, java.util.Map<DimensionValueCollection,AbstractOutputChunkCollection<? extends AbstractOutputChunk>> Table)
InputSpace
- The input space for the table lookup.Outputs
- The output chunks for the output layer of the table lookup.Table
- The table to use for looking up outputs from the table lookup.Method Detail |
---|
public void backwardPass()
In the backwardPass method, a value is specified by the feedback for a chosen output chunk and that value is then be set as the new activation for that output chunk within the collection of output chunks located at the slot in the hash map whose key matched the current input.
backwardPass
in interface InterfaceTrainable
backwardPass
in class AbstractTrainableImplicitModule
public void forwardPass()
When the forwardPass method is called, the table lookup takes the current input and compares it to the keys of the hash map until it finds a match. If no match is found, the forwardPass method does nothing. When a match is found, the method sets the activations of the output chunks of the table lookup to the activations of the output chunks contained within the collection located at the slot in the hash map whose key matched the current input.
forwardPass
in class AbstractImplicitModule
public boolean checkMatchCriterion()
This check is usually performed before the backwardPass method is called but after the setFeedback and setChosenAction methods have been called.
public java.lang.Double getSuccessRate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |