org.joone.net
Class NeuralNetValidator
- java.lang.Object
-
- org.joone.net.NeuralNetValidator
-
- All Implemented Interfaces:
- java.lang.Runnable, java.util.EventListener, NeuralNetListener
public class NeuralNetValidator extends java.lang.Object implements java.lang.Runnable, NeuralNetListener
This class is useful to validate a neural network. It simply sets some parameters of the neural network passed as parameter and starts itself in a separated thread, notifying a listener when the validation step finishes.
-
-
Constructor Summary
Constructors Constructor and Description NeuralNetValidator(NeuralNet nn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddValidationListener(NeuralValidationListener newListener)voidcicleTerminated(NeuralNetEvent e)voiderrorChanged(NeuralNetEvent e)voidfireNetValidated()NeuralNetgetNeuralNet()Gets the network to validate (or has been validated).voidnetStarted(NeuralNetEvent e)voidnetStopped(NeuralNetEvent e)voidnetStoppedError(NeuralNetEvent e, java.lang.String error)voidrun()voidstart()Starts the validation into a separated threadvoiduseTrainingData(boolean anUse)By default the validator validates a neural network with validation data, however by calling this method before calling thestart()method, one can decide if the network should be validated with validation data (the parameteranUseshould befalse) or by using the training data (the parameteranUseshould betrue).
-
-
-
Constructor Detail
-
NeuralNetValidator
public NeuralNetValidator(NeuralNet nn)
-
-
Method Detail
-
addValidationListener
public void addValidationListener(NeuralValidationListener newListener)
-
fireNetValidated
public void fireNetValidated()
-
useTrainingData
public void useTrainingData(boolean anUse)
By default the validator validates a neural network with validation data, however by calling this method before calling thestart()method, one can decide if the network should be validated with validation data (the parameteranUseshould befalse) or by using the training data (the parameteranUseshould betrue).- Parameters:
anUse-trueif we should use training data for validation,falseif we should use the validation data for validation (default).
-
start
public void start()
Starts the validation into a separated thread
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
netStopped
public void netStopped(NeuralNetEvent e)
- Specified by:
netStoppedin interfaceNeuralNetListener
-
cicleTerminated
public void cicleTerminated(NeuralNetEvent e)
- Specified by:
cicleTerminatedin interfaceNeuralNetListener
-
netStarted
public void netStarted(NeuralNetEvent e)
- Specified by:
netStartedin interfaceNeuralNetListener
-
errorChanged
public void errorChanged(NeuralNetEvent e)
- Specified by:
errorChangedin interfaceNeuralNetListener
-
netStoppedError
public void netStoppedError(NeuralNetEvent e, java.lang.String error)
- Specified by:
netStoppedErrorin interfaceNeuralNetListener
-
getNeuralNet
public NeuralNet getNeuralNet()
Gets the network to validate (or has been validated).- Returns:
- the netork to validate (or the network that has been validated).
-
-
DataMelt 3.0 © DataMelt by jWork.ORG