Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

AI.NeuralNetworks
Class BackErrorPropagation  view BackErrorPropagation download BackErrorPropagation.java

java.lang.Object
  extended byAI.NeuralNetworks.FeedForwardNetwork
      extended byAI.NeuralNetworks.BackErrorPropagation
All Implemented Interfaces:
NeuralNetworkTeacher
Direct Known Subclasses:
DistributedBackErrorPropagation

public class BackErrorPropagation
extends FeedForwardNetwork
implements NeuralNetworkTeacher

This Class is a nerual network with a multiple layer feed forward architecture where the back error propagation could be run


Field Summary
protected static java.lang.String COMMENT_TOKEN
           
protected static float DEFAULT_LEARNING_RATE
           
protected static long DEFAULT_MAXIMUM_EPOCH
           
protected static float DEFAULT_MOMENTUM_RATE
           
protected static float DEFAULT_STOP_ERROR
           
protected static java.lang.String END_TOKEN
           
protected static java.lang.String INPUT_TOKEN
           
protected  float learningRate
           
protected  long maximumEpoch
           
protected  float momentumRate
           
protected  Notify notifyError
           
protected static java.lang.String OUTPUT_TOKEN
           
protected  float stopError
           
protected static java.lang.String VECTOR_TOKEN
           
 
Fields inherited from class AI.NeuralNetworks.FeedForwardNetwork
HEXADECIMAL_VERSION, INPUT_LAYER_TOKEN, layers, NUMBER_OF_LAYERS_TOKEN, VERSION, VERSION_TOKEN, WEIGHTED_LAYER_TOKEN, WEIGHTS_TOKEN
 
Constructor Summary
protected BackErrorPropagation()
          this construcctor should not be used it is here for inheriterence only
  BackErrorPropagation(FeedForwardNetwork network)
          Creates a new BackErrorPropagation instance
  BackErrorPropagation(FeedForwardNetwork network, float learningRate, float momentumRate, long maximumEpoch, float stopError)
          Creates a new BackErrorPropagation instance
 
Method Summary
 void addDeltaWeights()
          Adds the deltaWeights to the weights
 void adjustDeltaWeights(float[] input, float[] expectedOutput)
          Calculates the delta weights for this pattern and adds it to the acumlated deltas
private static java.util.StringTokenizer getNextStringTokenizer(java.io.BufferedReader input, java.lang.String token)
           
static java.util.LinkedList getVectors(java.io.BufferedReader input)
           
static java.util.LinkedList getVectorsFormFile(java.lang.String fileName)
           
static int[] parseStructure(java.lang.String stringStructure)
          converts a string composed by tokens that could be converted to int to an array of int
 void resetDeltaWeights()
          Sets the acumulated delta weights to 0
 void setLearnningRate(float newRate)
          Sets the learnning rate
 void setMaximumEpoch(int newMaxEpoch)
          Sets the maximum epoch
 void setNotifyError(Notify notifyError)
          Sets an implementation of Notify, that will be notified of the error of each epoch
 void setStopError(float newStopError)
          Sets the stop error
 float trainNetwork(java.util.LinkedList trainingPatterns)
          Trains the network with the given patterns
 
Methods inherited from class AI.NeuralNetworks.FeedForwardNetwork
inputSize, netToIntArrey, outputSize, runVector, save, saveToFile, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMMENT_TOKEN

protected static final java.lang.String COMMENT_TOKEN
See Also:
Constant Field Values

INPUT_TOKEN

protected static final java.lang.String INPUT_TOKEN
See Also:
Constant Field Values

OUTPUT_TOKEN

protected static final java.lang.String OUTPUT_TOKEN
See Also:
Constant Field Values

VECTOR_TOKEN

protected static final java.lang.String VECTOR_TOKEN
See Also:
Constant Field Values

END_TOKEN

protected static final java.lang.String END_TOKEN
See Also:
Constant Field Values

DEFAULT_LEARNING_RATE

protected static float DEFAULT_LEARNING_RATE

DEFAULT_MOMENTUM_RATE

protected static float DEFAULT_MOMENTUM_RATE

DEFAULT_MAXIMUM_EPOCH

protected static long DEFAULT_MAXIMUM_EPOCH

DEFAULT_STOP_ERROR

protected static float DEFAULT_STOP_ERROR

learningRate

protected float learningRate

momentumRate

protected float momentumRate

maximumEpoch

protected long maximumEpoch

stopError

protected float stopError

notifyError

protected Notify notifyError
Constructor Detail

BackErrorPropagation

public BackErrorPropagation(FeedForwardNetwork network,
                            float learningRate,
                            float momentumRate,
                            long maximumEpoch,
                            float stopError)
Creates a new BackErrorPropagation instance


BackErrorPropagation

public BackErrorPropagation(FeedForwardNetwork network)
Creates a new BackErrorPropagation instance


BackErrorPropagation

protected BackErrorPropagation()
this construcctor should not be used it is here for inheriterence only

Method Detail

trainNetwork

public float trainNetwork(java.util.LinkedList trainingPatterns)
                   throws UnexpectedInputArraySizeException
Trains the network with the given patterns

Specified by:
trainNetwork in interface NeuralNetworkTeacher

resetDeltaWeights

public void resetDeltaWeights()
Sets the acumulated delta weights to 0


adjustDeltaWeights

public void adjustDeltaWeights(float[] input,
                               float[] expectedOutput)
                        throws UnexpectedInputArraySizeException
Calculates the delta weights for this pattern and adds it to the acumlated deltas


addDeltaWeights

public void addDeltaWeights()
Adds the deltaWeights to the weights


setNotifyError

public void setNotifyError(Notify notifyError)
Sets an implementation of Notify, that will be notified of the error of each epoch


setLearnningRate

public void setLearnningRate(float newRate)
Sets the learnning rate


setMaximumEpoch

public void setMaximumEpoch(int newMaxEpoch)
Sets the maximum epoch


setStopError

public void setStopError(float newStopError)
Sets the stop error


getVectorsFormFile

public static java.util.LinkedList getVectorsFormFile(java.lang.String fileName)

getVectors

public static java.util.LinkedList getVectors(java.io.BufferedReader input)

parseStructure

public static int[] parseStructure(java.lang.String stringStructure)
converts a string composed by tokens that could be converted to int to an array of int


getNextStringTokenizer

private static java.util.StringTokenizer getNextStringTokenizer(java.io.BufferedReader input,
                                                                java.lang.String token)
                                                         throws java.io.IOException,
                                                                java.util.NoSuchElementException