|
||||||||||
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
public abstract class AbstractNeuralNet
This class implements a three-layer, feed-forward neural network within CLARION. It extends the AbstractTrainableImplicitModule class. This class is abstract and therefore cannot be instantiated on its own.
Usage:
This class provides the framework for implementing a three-layer, feed forward neural network. If you want to define your own three-layer, feed forward network can do so by extending this class. Any classes that extend this class can be used as an implicit module on the bottom level of the CLARION subsystems.
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 | |
---|---|
static double |
GLOBAL_LOWER_INIT_THRESHOLD
The low bound for the initial threshold. |
static double |
GLOBAL_LOWER_INIT_WEIGHT
The low bound for the initial weights. |
static double |
GLOBAL_UPPER_INIT_THRESHOLD
The upper bound for the initial threshold. |
static double |
GLOBAL_UPPER_INIT_WEIGHT
The upper bound for the initial weights. |
protected java.util.ArrayList<java.lang.Double> |
Hidden
The hidden layer. |
protected java.util.ArrayList<java.lang.Double> |
HiddenThresholds
The thresholds for the hidden layer. |
protected java.util.ArrayList<java.util.ArrayList<java.lang.Double>> |
HiddenToOutputWeights
The hidden to output weight matrix. |
protected java.util.ArrayList<java.util.ArrayList<java.lang.Double>> |
InputToHiddenWeights
The input to hidden weight matrix. |
double |
LOWER_INIT_THRESHOLD
The low bound for the initial threshold. |
double |
LOWER_INIT_WEIGHT
The low bound for the initial weights. |
protected java.util.ArrayList<java.lang.Double> |
OutputThresholds
The thresholds for the output layer. |
double |
UPPER_INIT_THRESHOLD
The upper bound for the initial threshold. |
double |
UPPER_INIT_WEIGHT
The upper bound for the initial weights. |
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 | |
---|---|
AbstractNeuralNet(java.util.Collection<Dimension> InputSpace,
int NumHidden,
AbstractOutputChunkCollection<? extends AbstractOutputChunk> Outputs)
Initializes a neural network. |
Method Summary | |
---|---|
abstract void |
backwardPass()
Updates the neural network. |
protected abstract void |
computeHiddenActivation()
Calculates the hidden derivative. |
protected abstract void |
computeOutputActivation()
Calculates the output derivative. |
void |
forwardPass()
Calculates the output activations based on the current input. |
java.util.List<java.lang.Double> |
getHiddenThresholds()
Gets the hidden layer thresholds. |
java.util.List<java.util.List<java.lang.Double>> |
getHtoOWeightMatrix()
Gets the hidden to output layer weight matrix. |
java.util.List<java.util.List<java.lang.Double>> |
getItoHWeightMatrix()
Gets the input to hidden layer weight matrix. |
int |
getNumHidden()
Gets the number of hidden nodes. |
java.util.List<java.lang.Double> |
getOutputThresholds()
Gets the output layer thresholds. |
void |
hardcodeWeights(java.util.List<? extends java.util.List<java.lang.Double>> ItoH,
java.util.List<? extends java.util.List<java.lang.Double>> HtoO,
java.util.List<java.lang.Double> HiddenThreshold,
java.util.Collection<java.lang.Double> OutputThreshold)
Hard codes the weights of a neural net. |
private void |
initWeights()
Initializes the weights to random values. |
protected abstract void |
modifyHiddenToOutput()
Modifies the weights of the hidden to output layer. |
protected abstract void |
modifyInputToHidden()
Modifies the weights of input to hidden layer. |
private double |
randomThresholds()
Generates a random threshold. |
private double |
randomWeights()
Generates a random weight. |
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 |
---|
protected java.util.ArrayList<java.lang.Double> Hidden
protected java.util.ArrayList<java.lang.Double> HiddenThresholds
protected java.util.ArrayList<java.lang.Double> OutputThresholds
protected java.util.ArrayList<java.util.ArrayList<java.lang.Double>> InputToHiddenWeights
protected java.util.ArrayList<java.util.ArrayList<java.lang.Double>> HiddenToOutputWeights
public static double GLOBAL_UPPER_INIT_WEIGHT
public static double GLOBAL_LOWER_INIT_WEIGHT
public static double GLOBAL_UPPER_INIT_THRESHOLD
public static double GLOBAL_LOWER_INIT_THRESHOLD
public double UPPER_INIT_WEIGHT
public double LOWER_INIT_WEIGHT
public double UPPER_INIT_THRESHOLD
public double LOWER_INIT_THRESHOLD
Constructor Detail |
---|
public AbstractNeuralNet(java.util.Collection<Dimension> InputSpace, int NumHidden, AbstractOutputChunkCollection<? extends AbstractOutputChunk> Outputs)
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.
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 int getNumHidden()
public java.util.List<java.util.List<java.lang.Double>> getItoHWeightMatrix()
public java.util.List<java.util.List<java.lang.Double>> getHtoOWeightMatrix()
public java.util.List<java.lang.Double> getHiddenThresholds()
public java.util.List<java.lang.Double> getOutputThresholds()
public void hardcodeWeights(java.util.List<? extends java.util.List<java.lang.Double>> ItoH, java.util.List<? extends java.util.List<java.lang.Double>> HtoO, java.util.List<java.lang.Double> HiddenThreshold, java.util.Collection<java.lang.Double> OutputThreshold)
ItoH
- The Input to Hidden layer weights.HtoO
- The Hidden to Output layer weights.HiddenThreshold
- The thresholds for the hidden layer.OutputThreshold
- The thresholds for the output layer.public void forwardPass()
forwardPass
in class AbstractImplicitModule
private void initWeights()
private double randomWeights()
private double randomThresholds()
protected abstract void computeHiddenActivation()
protected abstract void computeOutputActivation()
protected abstract void modifyHiddenToOutput()
protected abstract void modifyInputToHidden()
public abstract void backwardPass()
backwardPass
in interface InterfaceTrainable
backwardPass
in class AbstractTrainableImplicitModule
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |