Neuroph

org.neuroph.core.learning
Class LearningRule

java.lang.Object
  extended by java.util.Observable
      extended by org.neuroph.core.learning.LearningRule
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable
Direct Known Subclasses:
HopfieldLearning, IterativeLearning, KohonenLearning

public abstract class LearningRule
extends java.util.Observable
implements java.lang.Runnable, java.io.Serializable

The LearningRule class is the base class for all neural network learning algorithms. It provides the general principles for training neural network.

See Also:
Serialized Form

Field Summary
protected  NeuralNetwork neuralNetwork
          Neural network to train
private static long serialVersionUID
          The class fingerprint that is set to indicate serialization compatibility with a previous version of the class
private  boolean stopLearning
          Flag to stop learning
private  TrainingSet trainingSet
          Collection of training elements
 
Constructor Summary
LearningRule(NeuralNetwork network)
          Sets neural network for this learning rule
 
Method Summary
 TrainingSet getTrainingSet()
          Gets training set
 boolean isStopped()
          Returns true if learning has stopped, false otherwise
abstract  void learn(TrainingSet trainingSet)
          Override this method to implement specific learning procedures
protected  void notifyChange()
          Notify observers about change
 void run()
          Method from Runnable interface for running learning procedure in separate thread.
 void setTrainingSet(TrainingSet trainingSet)
          Sets training set for this learning rule
 void stopLearning()
          Stops learning
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
The class fingerprint that is set to indicate serialization compatibility with a previous version of the class

See Also:
Constant Field Values

neuralNetwork

protected NeuralNetwork neuralNetwork
Neural network to train


trainingSet

private transient TrainingSet trainingSet
Collection of training elements


stopLearning

private transient boolean stopLearning
Flag to stop learning

Constructor Detail

LearningRule

public LearningRule(NeuralNetwork network)
Sets neural network for this learning rule

Parameters:
network - neural network to train
Method Detail

setTrainingSet

public void setTrainingSet(TrainingSet trainingSet)
Sets training set for this learning rule

Parameters:
trainingSet - training set for this learning rule

getTrainingSet

public TrainingSet getTrainingSet()
Gets training set

Returns:
training set

run

public void run()
Method from Runnable interface for running learning procedure in separate thread.

Specified by:
run in interface java.lang.Runnable

stopLearning

public void stopLearning()
Stops learning


isStopped

public boolean isStopped()
Returns true if learning has stopped, false otherwise

Returns:
true if learning has stopped, false otherwise

notifyChange

protected void notifyChange()
Notify observers about change


learn

public abstract void learn(TrainingSet trainingSet)
Override this method to implement specific learning procedures

Parameters:
trainingSet - training set

Neuroph