clarion.system
Class AbstractRuntimeTrainableBPNet

java.lang.Object
  extended by clarion.system.AbstractImplicitModule
      extended by clarion.system.AbstractTrainableImplicitModule
          extended by clarion.system.AbstractNeuralNet
              extended by clarion.system.BPNet
                  extended by clarion.system.AbstractRuntimeTrainableBPNet
All Implemented Interfaces:
InterfaceHandlesFeedback, InterfaceRuntimeTrainable, InterfaceTracksMatchStatistics, InterfaceTrainable
Direct Known Subclasses:
QBPNet, SimplifiedQBPNet

public abstract class AbstractRuntimeTrainableBPNet
extends BPNet
implements InterfaceRuntimeTrainable, InterfaceTracksMatchStatistics

This class implements a runtime trainable backpropagating neural network within CLARION. It extends the BPNet class and implements the InterfaceRuntimeTrainable and InterfaceTracksMatchStatistics interfaces. This class is abstract and therefore cannot be instantiated on its own.

Usage:

The runtime trainable BP Net is a framework for building a backpropagating neural network that can be used as an implicit module in the bottom level of the CLARION subsystems. A runtime trainable BP Net is unique from other BP Nets in that it can be trained during runtime. Any BP Nets that extend this class will be capable of being trained during runtime within the CLARION library.

Known Subclasses:

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.

Version:
6.0.4
Author:
Nick Wilson

Field Summary
protected  double Feedback
          The immediate feedback given to the network (if given).
static double GLOBAL_POSITIVE_MATCH_THRESHOLD
          The threshold for the positive match criterion.
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.BPNet
GLOBAL_LEARNING_RATE, GLOBAL_MOMENTUM, GLOBAL_RZERO, LEARNING_RATE, MOMENTUM, RZERO
 
Fields inherited from class clarion.system.AbstractNeuralNet
GLOBAL_LOWER_INIT_THRESHOLD, GLOBAL_LOWER_INIT_WEIGHT, GLOBAL_UPPER_INIT_THRESHOLD, GLOBAL_UPPER_INIT_WEIGHT, Hidden, HiddenThresholds, HiddenToOutputWeights, InputToHiddenWeights, LOWER_INIT_THRESHOLD, LOWER_INIT_WEIGHT, OutputThresholds, UPPER_INIT_THRESHOLD, UPPER_INIT_WEIGHT
 
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
AbstractRuntimeTrainableBPNet(java.util.Collection<Dimension> InputSpace, int NumHidden, AbstractOutputChunkCollection<? extends AbstractOutputChunk> Outputs)
          Initializes a backpropagating neural network that is capable of being trained during runtime.
 
Method Summary
 double getFeedback()
          Gets the immediate feedback that was last provided to the rule.
 double getNM()
          Gets the negative match statistic.
 double getPM()
          Gets the positive match statistic.
 void incrementNM()
          Increments the negative match statistic.
 void incrementPM()
          Increments the positive match statistic.
 void resetMatchStatistics()
          Resets the match statistics.
 void setFeedback(double feedback)
          Sets the immediate feedback for the rule.
 void setNM(double nm)
          Sets the negative match statistic.
 void setPM(double pm)
          Sets the positive match statistic.
 void updateMatchStatistics(AbstractMatchCalculator MatchCalculator)
          Updates the positive or negative match statistics based on the feedback.
 
Methods inherited from class clarion.system.BPNet
backwardPass, computeHiddenActivation, computeOutputActivation, modifyHiddenToOutput, modifyInputToHidden
 
Methods inherited from class clarion.system.AbstractNeuralNet
forwardPass, getHiddenThresholds, getHtoOWeightMatrix, getItoHWeightMatrix, getNumHidden, getOutputThresholds, hardcodeWeights
 
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
backwardPass, getSumSqErrors, setDesiredOutput, setDesiredOutput
 
Methods inherited from interface clarion.system.InterfaceHandlesFeedback
checkMatchCriterion
 

Field Detail

Feedback

protected double Feedback
The immediate feedback given to the network (if given).


PM

protected double PM
The positive match counter.


NM

protected double NM
The negative match counter.


GLOBAL_POSITIVE_MATCH_THRESHOLD

public static double GLOBAL_POSITIVE_MATCH_THRESHOLD
The threshold for the positive match criterion.


POSITIVE_MATCH_THRESHOLD

public double POSITIVE_MATCH_THRESHOLD
The threshold for the positive match criterion.

Constructor Detail

AbstractRuntimeTrainableBPNet

public AbstractRuntimeTrainableBPNet(java.util.Collection<Dimension> InputSpace,
                                     int NumHidden,
                                     AbstractOutputChunkCollection<? extends AbstractOutputChunk> Outputs)
                              throws InvalidFormatException
Initializes a backpropagating neural network that is capable of being trained during runtime.

If this is being used as an implicit module in the ACS and you are using goals or specialized working memory chunks, remember that the input space must also contain all dimension-value pairs within those chunks that differ from the sensory information space.

Parameters:
InputSpace - A collection of dimension-value pairs to set as the input nodes.
NumHidden - The number of hidden nodes.
Outputs - The chunks to associate with the output layer.
Throws:
InvalidFormatException - If the input space contains two dimensions with the same ID or the output contains two output chunks with the same ID.
Method Detail

getPM

public double getPM()
Gets the positive match statistic.

Specified by:
getPM in interface InterfaceTracksMatchStatistics
Returns:
The positive match statistic.

getNM

public double getNM()
Gets the negative match statistic.

Specified by:
getNM in interface InterfaceTracksMatchStatistics
Returns:
The negative match statistic.

setPM

public void setPM(double pm)
Sets the positive match statistic. This method can be used to update the positive match statistic if the user wishes to provide their own match criterion function.

Specified by:
setPM in interface InterfaceTracksMatchStatistics
Parameters:
pm - The value to set as the positive match statistic.

setNM

public void setNM(double nm)
Sets the negative match statistic. This method can be used to update the negative match statistic if the user wishes to provide their own match criterion function.

Specified by:
setNM in interface InterfaceTracksMatchStatistics
Parameters:
nm - The value to set as the negative match statistic.

getFeedback

public double getFeedback()
Gets the immediate feedback that was last provided to the rule. This method is only used if feedback is being provided.

Specified by:
getFeedback in interface InterfaceHandlesFeedback
Returns:
The feedback.

setFeedback

public void setFeedback(double feedback)
Sets the immediate feedback for the rule. This method should be called before the updateMatchStatistics method is called. This method is only used if feedback is being provided.

Specified by:
setFeedback in interface InterfaceHandlesFeedback
Parameters:
feedback - The value of the feedback.

updateMatchStatistics

public void updateMatchStatistics(AbstractMatchCalculator MatchCalculator)
Updates the positive or negative match statistics based on the feedback.

This update is usually performed after the feedback has been set.

Specified by:
updateMatchStatistics in interface InterfaceTracksMatchStatistics
Parameters:
MatchCalculator - The match calculator to use to determine positivity.

resetMatchStatistics

public void resetMatchStatistics()
Resets the match statistics.

Specified by:
resetMatchStatistics in interface InterfaceTracksMatchStatistics

incrementPM

public void incrementPM()
Increments the positive match statistic. This method can be used to update the positive match statistic if the user wishes to provide their own match criterion function.

Specified by:
incrementPM in interface InterfaceTracksMatchStatistics

incrementNM

public void incrementNM()
Increments the negative match statistic. This method can be used to update the negative match statistic if the user wishes to provide their own match criterion function.

Specified by:
incrementNM in interface InterfaceTracksMatchStatistics