public abstract class LearningRule extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected List<LearningEventListener> |
listeners
List of learning rule listeners
|
protected NeuralNetwork<?> |
neuralNetwork
Neural network to train
|
protected DataSet |
trainingSet
Training data set
|
Constructor and Description |
---|
LearningRule()
Creates new instance of learning rule
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(LearningEventListener listener) |
protected void |
fireLearningEvent(LearningEvent evt) |
NeuralNetwork |
getNeuralNetwork()
Gets neural network
|
DataSet |
getTrainingSet()
Gets training set
|
boolean |
isStopped()
Returns true if learning has stopped, false otherwise
|
abstract void |
learn(DataSet trainingSet)
Override this method to implement specific learning procedures
|
protected void |
onStart()
Prepares the learning rule to run by setting stop flag to false
If you override this method make sure you call parent method first
|
protected void |
onStop()
Invoked after the learning has stopped
|
void |
removeListener(LearningEventListener listener) |
void |
setNeuralNetwork(NeuralNetwork neuralNetwork)
Sets neural network for this learning rule
|
void |
setTrainingSet(DataSet trainingSet)
Sets training set for this learning rule
|
void |
stopLearning()
Stops learning
|
protected NeuralNetwork<?> neuralNetwork
protected transient DataSet trainingSet
protected transient List<LearningEventListener> listeners
public void setTrainingSet(DataSet trainingSet)
trainingSet
- training set for this learning rulepublic DataSet getTrainingSet()
public NeuralNetwork getNeuralNetwork()
public void setNeuralNetwork(NeuralNetwork neuralNetwork)
neuralNetwork
- neural network for this learning ruleprotected void onStart()
protected void onStop()
public void stopLearning()
public boolean isStopped()
public void addListener(LearningEventListener listener)
public void removeListener(LearningEventListener listener)
protected void fireLearningEvent(LearningEvent evt)
public abstract void learn(DataSet trainingSet)
trainingSet
- training setCopyright © 2019 Neuroph Project. All rights reserved.