com.penguinwerks.jodene.listeners
Class StopOnErrorListener

java.lang.Object
  extended bycom.penguinwerks.jodene.listeners.StopOnErrorListener
All Implemented Interfaces:
EpochEventListener

public class StopOnErrorListener
extends java.lang.Object
implements EpochEventListener

This implementation of the epoch listener interface sets a threshold error. Once the error from training drops below the threshold value, training is stopped. This should not be used without some kind of max iteration listener.

Author:
Paul Hoehne

Constructor Summary
StopOnErrorListener()
          Default constructor.
StopOnErrorListener(double val)
          Constructor that sets the error threshold.
 
Method Summary
 void epochEnd(TrainingEpochEvent evt)
          An implementation of the EpochEventListener interface.
 double getError()
          Returns the error threshold.
 java.lang.String getErrorName()
          Returns the name of the error to listen to.
 void setError(double error)
          Sets the error threshold.
 void setErrorName(java.lang.String val)
          Sets the name of the error to listen to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StopOnErrorListener

public StopOnErrorListener()
Default constructor.


StopOnErrorListener

public StopOnErrorListener(double val)
Constructor that sets the error threshold.

Parameters:
val - The error threshold.
Method Detail

getErrorName

public java.lang.String getErrorName()
Returns the name of the error to listen to. This allows multiple stop on error listeners t listend to different errors.

Returns:
The name of the error listener.

setErrorName

public void setErrorName(java.lang.String val)
Sets the name of the error to listen to. This allows multiple stop on error listeners t listend to different errors.

Parameters:
val - The name of the error to listen to.

getError

public double getError()
Returns the error threshold.

Returns:
Returns the error.

setError

public void setError(double error)
Sets the error threshold.

Parameters:
error - The error to set.

epochEnd

public void epochEnd(TrainingEpochEvent evt)
An implementation of the EpochEventListener interface. Terminates training once the training error drops below the threshold value.

Specified by:
epochEnd in interface EpochEventListener
Parameters:
evt - The epoch event.