|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.joone.engine.Monitor
public class Monitor
The Monitor object is the controller of the behavior of the neural net. It controls the start/stop actions and permits to set the parameters of the net (learning rate, momentum, ecc.). Each component of the neural net (Layers and Synapses) are connected to a monitor object (the monitor can be different or the same for the all components).
| Field Summary | |
|---|---|
protected boolean |
backprop
Ability to switch on and off the error backpropagation method, specifically for use with RTRL |
int |
learningMode
|
| Constructor Summary | |
|---|---|
Monitor()
This is the default Constructor. |
|
| Method Summary | |
|---|---|
void |
addLearner(int i,
java.lang.String learner)
Adds a new Learner to the Neural Network Usage: Monitor.addLearner(0, "org.joone.engine.BasicLearner"); Monitor.addLearner(1, "org.joone.engine.BatchLearner"); Monitor.addLearner(2, "org.joone.engine.RpropLearner"); |
void |
addNeuralNetListener(NeuralNetListener l)
adds a neural net event listener the Monitor |
void |
addNeuralNetListener(NeuralNetListener l,
boolean removable)
adds a neural net event listener to the Monitor |
java.util.TreeSet |
check()
|
void |
fireCicleTerminated()
Invoked when an epoch finishes |
void |
fireErrorChanged()
Invoked when the GlobalError changes |
void |
fireErrorPattern()
|
void |
fireNetStarted()
Invoked when the net starts |
void |
fireNetStopped()
Invoked when all the epochs finish |
void |
fireNetStoppedError(java.lang.String errMsg)
Invoked when an error occurs |
int |
getBatchSize()
Getter for the property BatchSize |
int |
getCurrentCicle()
Returns the current epoch |
double |
getGlobalError()
Returns the actual (R)MSE of the NN |
java.lang.String[] |
getKeys()
Return all the keys of the parameters contained in this Monitor. |
Learner |
getLearner()
Gets a learner for a synapse or layer. |
Learner |
getLearner(int index)
Getter for the Learner declared at position 'index' |
protected java.util.List |
getLearners()
Getter for property learners. |
int |
getLearningMode()
Getter for property learningMode. |
double |
getLearningRate()
Returns the learning rate |
double |
getMomentum()
Returns the momentum |
int |
getNumOfPatterns()
|
java.lang.Object |
getParam(java.lang.String key)
Gets a custom parameter from the Monitor. |
Monitor |
getParent()
Getter for property parent. |
int |
getPreLearning()
Returns the initial ignored input patterns (during the training phase) |
int |
getRun()
Needed for XML saving |
int |
getStep()
Returns the actual elaborated pattern |
int |
getTotCicles()
Returns the total number of epochs |
int |
getTrainingPatterns()
Returns the number of the input training patterns |
int |
getValidationPatterns()
Returns the number of the input validation patterns |
void |
Go()
Deprecated. |
boolean |
isBackprop()
See if the backprop is enabled |
boolean |
isExporting()
Getter for property exporting. |
boolean |
isLearning()
Returns TRUE if the net is into a learning phase |
boolean |
isLearningCicle(int num)
Returns the phase of the net (learning or not) for the current pattern |
boolean |
isSingleThreadMode()
|
boolean |
isSupervised()
Getter for property supervised. |
boolean |
isTrainingDataForValidation()
Getter for the property trainingDataForValidation, i.e. |
boolean |
isUseRMSE()
Checks if we should use RMSE (true) or MSE false. |
boolean |
isValidation()
Getter for property validation. |
boolean |
nextStep()
Returns if the next pattern must be elaborated |
protected java.lang.Object |
readResolve()
|
void |
removeAllListeners()
Removes all the NeuralNetListeners. |
void |
removeNeuralNetListener(NeuralNetListener l)
Removes a listener |
void |
resetCycle()
|
void |
runAgain()
Let continue the net. |
void |
setBackprop(boolean backprop)
Turns backpropagation on or off |
void |
setBatchSize(int i)
Setter for the property BatchSize |
void |
setCurrentCicle(int newCurrentCicle)
Not used |
void |
setExporting(boolean exporting)
Setter for property exporting. |
void |
setGlobalError(double newGlobalError)
Sets the actual error of the NN |
void |
setLearnerFactory(LearnerFactory aFactory)
Set learner factory. |
protected void |
setLearners(java.util.List learners)
Setter for property learners. |
void |
setLearning(boolean newLearning)
Sets the phase of the neural network: learning (true) or recall (false) |
void |
setLearningMode(int learningMode)
Setter for property learningMode. |
void |
setLearningRate(double newLearningRate)
Sets the learning rate |
void |
setMomentum(double newMomentum)
Sets the momentum |
void |
setParam(java.lang.String key,
java.lang.Object obj)
Sets a custom parameter of the Monitor. |
void |
setParent(Monitor parent)
Setter for property parent. |
void |
setPreLearning(int newPreLearning)
Sets the initial ignored input patterns (during the training phase) |
void |
setSingleThreadMode(boolean singleThreadMode)
|
void |
setSupervised(boolean supervised)
Setter for property supervised. |
void |
setTotCicles(int newTotCicles)
Sets the total number of epochs |
void |
setTrainingDataForValidation(boolean aMode)
Setter for the property trainingDataForValidation. |
void |
setTrainingPatterns(int newPatterns)
Sets the number of the input training patterns |
void |
setUseRMSE(boolean aMode)
Uses the RMSE when set to true. |
void |
setValidation(boolean validation)
Setter for property validation. |
void |
setValidationPatterns(int newPatterns)
Sets the number of the input validation patterns |
void |
Stop()
Stops the NN when running in multi-thread mode. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public int learningMode
protected boolean backprop
| Constructor Detail |
|---|
public Monitor()
| Method Detail |
|---|
public void addNeuralNetListener(NeuralNetListener l)
l - NeuralNetListener
public void addNeuralNetListener(NeuralNetListener l,
boolean removable)
l - the new NeuralNetListenerremovable - true if the added listener can be removed by the removeAllListeners method callpublic void fireCicleTerminated()
public void fireErrorPattern()
public void fireNetStarted()
public void fireNetStopped()
public void fireNetStoppedError(java.lang.String errMsg)
errMsg - the thrown error messagepublic void fireErrorChanged()
public int getCurrentCicle()
public double getGlobalError()
public double getLearningRate()
public double getMomentum()
public int getTrainingPatterns()
public void setTrainingPatterns(int newPatterns)
newPatterns - intpublic int getPreLearning()
public int getStep()
public int getTotCicles()
@Deprecated public void Go()
org.joone.net.NeuralNet.go()public boolean isLearning()
public boolean isLearningCicle(int num)
num - the pattern requested
public void resetCycle()
public boolean nextStep()
protected java.lang.Object readResolve()
public void removeNeuralNetListener(NeuralNetListener l)
l - the listener to be removedpublic void runAgain()
public void setCurrentCicle(int newCurrentCicle)
newCurrentCicle - intpublic void setGlobalError(double newGlobalError)
newGlobalError - doublepublic void setLearning(boolean newLearning)
newLearning - booleanpublic void setLearningRate(double newLearningRate)
newLearningRate - doublepublic void setMomentum(double newMomentum)
newMomentum - doublepublic void setPreLearning(int newPreLearning)
newPreLearning - intpublic void setTotCicles(int newTotCicles)
newTotCicles - intpublic void Stop()
org.joone.net.NeuralNet.stop()public boolean isExporting()
public void setExporting(boolean exporting)
exporting - New value of property exporting.public int getRun()
public boolean isValidation()
public void setValidation(boolean validation)
validation - New value of property validation.public boolean isTrainingDataForValidation()
public void setTrainingDataForValidation(boolean aMode)
aMode - true if the training data should be used for validation,
false otherwise.public void removeAllListeners()
addNeuralNetListenerpublic Monitor getParent()
public void setParent(Monitor parent)
parent - New value of property parent.public int getValidationPatterns()
public void setValidationPatterns(int newPatterns)
newPatterns - intpublic int getNumOfPatterns()
public java.util.TreeSet check()
public boolean isSupervised()
public void setSupervised(boolean supervised)
supervised - New value of property supervised.public int getBatchSize()
public void setBatchSize(int i)
the - size (# of cycles) of the batch modepublic int getLearningMode()
getLearners()public void setLearningMode(int learningMode)
learningMode - New value of property learningMode.public Learner getLearner(int index)
the - index of the Learner to get
getLearners()public Learner getLearner()
protected java.util.List getLearners()
protected void setLearners(java.util.List learners)
learners - New value of property learners.
public void addLearner(int i,
java.lang.String learner)
i - the index of the new Learnerlearner - a String containing the class name of the Learner to addpublic java.lang.Object getParam(java.lang.String key)
key - The searched key
public void setParam(java.lang.String key,
java.lang.Object obj)
key - The key of the paramobj - The value of the parampublic java.lang.String[] getKeys()
public void setUseRMSE(boolean aMode)
aMode - the mode to set true for RMSE, false for MSE.public boolean isUseRMSE()
public void setLearnerFactory(LearnerFactory aFactory)
aFactory - the learner factory to set.public boolean isSingleThreadMode()
public void setSingleThreadMode(boolean singleThreadMode)
public boolean isBackprop()
public void setBackprop(boolean backprop)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||