|
||||||||||
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.AbstractNeuralNet
clarion.system.BPNet
public class BPNet
This class implements a 3-layer standard backpropagating neural network within CLARION. It extends the AbstractNeuralNetwork class.
Usage:
A standard backpropagating neural network is the base type of network in CLARION and while it can be used as the neural network for the bottom level of any subsystem of CLARION, it is not considered to be capable of "ONLINE" (or runtime) learning. Therefore, the network should be pre-trained "offline" before it is added to the appropriate CLARION subsystem. The weight vectors and thresholds for the network can be hardcoded if they were recorded from a previous training session.
The Input for the neural network is a collection of dimension-values where each value represents one node.
If the network is being used as an action network 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.
Once the input space has been defined it cannot be changed. At any given forward pass through the network, the network can accept an arbitrary collection of dimension-values as input, but it will only adjust the activations of the inputs that were specified during initialization.
The nodes in the output layer are represented as output chunks.
The general procedure when using this class is:
Note: The current implementation of CLARION does not allow for multiple action dimensions on the bottom level as stipulated in the CLARION tutorial. However, actions that contain multiple action dimensions are still possible by simply specifying action chunks on the top level that contain multiple activated action dimensions. This is the case because the output of the bottom level only specifies actions and not action dimension-values.
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.
Field Summary | |
---|---|
private java.util.ArrayList<java.lang.Double> |
Errors
The errors of the output |
static double |
GLOBAL_LEARNING_RATE
Learning rate. |
static double |
GLOBAL_MOMENTUM
Momentum. |
static double |
GLOBAL_RZERO
Tolerance of error. |
private java.util.ArrayList<java.lang.Double> |
HiddenDeriv
The derivative of the hidden layers. |
private java.util.ArrayList<java.lang.Double> |
HiddenErrors
The errors of the hidden layer. |
private java.util.ArrayList<java.lang.Double> |
HiddenMomentum
The momentum for the hidden layers. |
private java.util.ArrayList<java.util.ArrayList<java.lang.Double>> |
HiddenToOutputMomentum
The hidden to output momentum matrix. |
private java.util.ArrayList<java.util.ArrayList<java.lang.Double>> |
InputToHiddenMomentum
The input to hidden momentum matrix. |
double |
LEARNING_RATE
Learning rate. |
double |
MOMENTUM
Momentum. |
private java.util.ArrayList<java.lang.Double> |
OutputDeriv
The derivative of the output layers. |
private java.util.ArrayList<java.lang.Double> |
OutputMomentum
The momentum from the output layers. |
double |
RZERO
Tolerance of error. |
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 | |
---|---|
BPNet(java.util.Collection<Dimension> InputSpace,
int NumHidden,
AbstractOutputChunkCollection<? extends AbstractOutputChunk> Outputs)
Initializes a backpropagating neural network. |
Method Summary | |
---|---|
void |
backwardPass()
Updates the neural network using standard backpropagation. |
private void |
computeErrors()
Computes the errors of the output layer. |
protected void |
computeHiddenActivation()
Calculates the hidden derivative. |
private void |
computeHiddenErrors()
Computes the errors of the hidden layer. |
protected void |
computeOutputActivation()
Calculates the output derivative. |
private double |
derivative(double input)
The derivative of the activation function. |
protected void |
modifyHiddenToOutput()
Modifies the weights of the hidden to output layer. |
protected void |
modifyInputToHidden()
Modifies the weights of the input to hidden layer. |
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 |
Field Detail |
---|
private java.util.ArrayList<java.lang.Double> HiddenMomentum
private java.util.ArrayList<java.lang.Double> OutputMomentum
private java.util.ArrayList<java.util.ArrayList<java.lang.Double>> InputToHiddenMomentum
private java.util.ArrayList<java.util.ArrayList<java.lang.Double>> HiddenToOutputMomentum
private java.util.ArrayList<java.lang.Double> HiddenDeriv
private java.util.ArrayList<java.lang.Double> OutputDeriv
private java.util.ArrayList<java.lang.Double> HiddenErrors
private java.util.ArrayList<java.lang.Double> Errors
public static double GLOBAL_MOMENTUM
public double MOMENTUM
public static double GLOBAL_LEARNING_RATE
public double LEARNING_RATE
public static double GLOBAL_RZERO
public double RZERO
Constructor Detail |
---|
public BPNet(java.util.Collection<Dimension> InputSpace, int NumHidden, AbstractOutputChunkCollection<? extends AbstractOutputChunk> Outputs)
The Input for the neural network is a collection of dimension-values where each value represents one node.
If the network is being used as an action network 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.
Once the input space has been defined it cannot be changed. At any given forward pass through the network, the network can accept an arbitrary collection of dimension-values as input, but it will only adjust the activations of the inputs that were specified during initialization.
The nodes in the output layer are represented as output chunks.
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.Method Detail |
---|
public void backwardPass()
backwardPass
in interface InterfaceTrainable
backwardPass
in class AbstractNeuralNet
protected void computeHiddenActivation()
computeHiddenActivation
in class AbstractNeuralNet
protected void computeOutputActivation()
computeOutputActivation
in class AbstractNeuralNet
private void computeErrors()
private void computeHiddenErrors()
protected void modifyHiddenToOutput()
modifyHiddenToOutput
in class AbstractNeuralNet
protected void modifyInputToHidden()
modifyInputToHidden
in class AbstractNeuralNet
private double derivative(double input)
input
- The weighted input to the node.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |