org.joone.engine.listeners
Class DeltaBasedConvergenceObserver

java.lang.Object
  extended by org.joone.util.MonitorPlugin
      extended by org.joone.engine.listeners.ConvergenceObserver
          extended by org.joone.engine.listeners.DeltaBasedConvergenceObserver
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, NeuralNetListener

public class DeltaBasedConvergenceObserver
extends ConvergenceObserver

This observer observes if the network has convergenced based on the size of the weight updates (deltas).

Author:
Boris Jansen
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.joone.engine.listeners.ConvergenceObserver
disableCurrentConvergence
 
Constructor Summary
DeltaBasedConvergenceObserver()
          Creates a new instance of DeltaBasedConvergenceObserver
 
Method Summary
 int getCycles()
          Gets the number of cycles over which convergence is checked.
 NeuralNet getNeuralNet()
          Gets the neural net that is being checked for convergence.
 double getSize()
          Gets the size (delta bound for convergence).
protected  boolean isConvergence(Matrix aMatrix)
          Checks if the weights or biases have converged, i.e.
protected  void manageCycle(Monitor mon)
           
protected  void manageError(Monitor mon)
           
protected  void manageStart(Monitor mon)
           
protected  void manageStop(Monitor mon)
           
protected  void manageStopError(Monitor mon, java.lang.String msgErr)
           
 void setCycles(int aCylces)
          Sets the number of cycles.
 void setNeuralNet(NeuralNet aNet)
          Sets the neural network to be checked for convergence.
 void setSize(double aSize)
          Sets the size.
 
Methods inherited from class org.joone.engine.listeners.ConvergenceObserver
addConvergenceListener, disableCurrentConvergence, fireNetConverged, removeConvergenceListener
 
Methods inherited from class org.joone.util.MonitorPlugin
cicleTerminated, errorChanged, getName, getRate, netStarted, netStopped, netStoppedError, setName, setRate, toBeManaged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeltaBasedConvergenceObserver

public DeltaBasedConvergenceObserver()
Creates a new instance of DeltaBasedConvergenceObserver

Method Detail

setSize

public void setSize(double aSize)
Sets the size. Whenever the weight (biases) update values (deltas) are smaller than this value for a certain number of cycles (setCycles(), the network is considered as converged.

Parameters:
aSize - the size to set.

getSize

public double getSize()
Gets the size (delta bound for convergence).

Returns:
the size.

setCycles

public void setCycles(int aCylces)
Sets the number of cycles. Whenever the deltas are equal to or smaller than the set size for this number of cycles, the network is considered as converged.

Parameters:
aCylces -

getCycles

public int getCycles()
Gets the number of cycles over which convergence is checked.

Returns:
the number of cycles.

setNeuralNet

public void setNeuralNet(NeuralNet aNet)
Sets the neural network to be checked for convergence.

Overrides:
setNeuralNet in class MonitorPlugin
Parameters:
aNet - the network to set.

getNeuralNet

public NeuralNet getNeuralNet()
Gets the neural net that is being checked for convergence.

Overrides:
getNeuralNet in class MonitorPlugin
Returns:
the net that is being checked for convergence.

manageStop

protected void manageStop(Monitor mon)
Specified by:
manageStop in class MonitorPlugin

manageCycle

protected void manageCycle(Monitor mon)
Specified by:
manageCycle in class MonitorPlugin

manageStart

protected void manageStart(Monitor mon)
Specified by:
manageStart in class MonitorPlugin

manageError

protected void manageError(Monitor mon)
Specified by:
manageError in class MonitorPlugin

isConvergence

protected boolean isConvergence(Matrix aMatrix)
Checks if the weights or biases have converged, i.e. if the delta weight update value is below size.

Parameters:
aMatrix - the matrix (weights or biases) to check if their deltas are equal to or below size.
Returns:
true if the deltas are equal to or below size, false otherwise.

manageStopError

protected void manageStopError(Monitor mon,
                               java.lang.String msgErr)
Specified by:
manageStopError in class MonitorPlugin


Submit Feedback to pmarrone@users.sourceforge.net