org.joone.util
Class LearningSwitch

java.lang.Object
  extended by org.joone.engine.Synapse
      extended by org.joone.io.StreamInputSynapse
          extended by org.joone.io.InputSwitchSynapse
              extended by org.joone.util.LearningSwitch
All Implemented Interfaces:
java.io.Serializable, InputPatternListener, Learnable, LearnableSynapse, NeuralElement, OutputPatternListener, Inspectable, InputSynapse, PlugInListener

public class LearningSwitch
extends InputSwitchSynapse

This class is useful to switch the input data set of a neural network from a training set to a validation set depending on the 'validation' parameter contained in the Monitor object. Very useful during a training phase to test the generalization capacity of the neural network with a validation data set never seen before.

Author:
pmarrone
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.joone.io.InputSwitchSynapse
inputs
 
Fields inherited from class org.joone.io.StreamInputSynapse
cols, currentRow, EOF, InputVector, tokens
 
Fields inherited from class org.joone.engine.Synapse
array, b_pattern, bitems, bouts, count, enabled, fwdLock, inps, items, learnable, m_batch, m_pattern, myLearner, notFirstTime, notFirstTimeB, outs, revLock
 
Constructor Summary
LearningSwitch()
          Creates a new instance of LearningSwitch
 
Method Summary
 boolean addTrainingSet(StreamInputSynapse tSet)
           
 boolean addValidationSet(StreamInputSynapse vSet)
           
 java.util.TreeSet check()
          Check that parameters are set correctly.
 Pattern fwdGet()
          Connects the right input synapse depending on the Monitor's 'validation' parameter
 Pattern fwdGet(InputConnector conn)
          Connects the right input synapse depending on the Monitor's 'validation' parameter.
 StreamInputSynapse getTrainingSet()
          Getter for property trainingSet.
 StreamInputSynapse getValidationSet()
          Getter for property validationSet.
 void removeTrainingSet()
           
 void removeValidationSet()
           
 void setTrainingSet(StreamInputSynapse trainingSet)
          Setter for property trainingSet.
 void setValidationSet(StreamInputSynapse validationSet)
          Setter for property validationSet.
 
Methods inherited from class org.joone.io.InputSwitchSynapse
addInputSynapse, backward, dataChanged, forward, getActiveInput, getActiveSynapse, getAdvancedColumnSelector, getAllInputs, getDefaultInput, getDefaultSynapse, getFirstRow, getInputSynapse, getInspections, getLastRow, getMonitor, getName, getOutputDimension, getPlugIn, gotoFirstLine, gotoLine, init, initInputStream, initSwitch, isBuffered, isEOF, isStepCounter, numColumns, readAll, removeAllInputs, removeInputSynapse, reset, resetInput, resetSwitch, revPut, setActiveInput, setActiveSynapse, setAllInputs, setBuffered, setDecimalPoint, setDefaultInput, setDefaultSynapse, setMonitor, setName, setOutputDimension, setStepCounter
 
Methods inherited from class org.joone.io.StreamInputSynapse
addPlugIn, addPlugInListener, fireDataChanged, getAllPlugInListeners, getCurrentRow, getDecimalPoint, getFirstCol, getInputPatterns, getInputVector, getLastCol, getMaxBufSize, getStream, getTokens, InspectableTitle, Inspections, readObjectBase, removeAllPlugIns, removePlugInListener, setAdvancedColumnSelector, setArrays, setColList, setDimensions, setEOF, setFirstCol, setFirstRow, setInputPatterns, setLastCol, setLastRow, setMaxBufSize, setPlugin, setPlugIn, setTokens, writeObjectBase, zeroPattern
 
Methods inherited from class org.joone.engine.Synapse
addNoise, canCountSteps, fwdPut, getFwdLock, getIgnoreBefore, getInputDimension, getLearner, getLearningRate, getMomentum, getRevLock, getWeights, initLearner, isEnabled, isInputFull, isLoopBack, isOutputFull, randomize, readResolve, revGet, setEnabled, setIgnoreBefore, setInputDimension, setInputFull, setLearningRate, setLoopBack, setMomentum, setOutputFull, setWeights
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LearningSwitch

public LearningSwitch()
Creates a new instance of LearningSwitch

Method Detail

addTrainingSet

public boolean addTrainingSet(StreamInputSynapse tSet)

addValidationSet

public boolean addValidationSet(StreamInputSynapse vSet)

removeTrainingSet

public void removeTrainingSet()

removeValidationSet

public void removeValidationSet()

fwdGet

public Pattern fwdGet()
Connects the right input synapse depending on the Monitor's 'validation' parameter

Specified by:
fwdGet in interface InputPatternListener
Overrides:
fwdGet in class InputSwitchSynapse
Returns:
neural.engine.Pattern

fwdGet

public Pattern fwdGet(InputConnector conn)
Connects the right input synapse depending on the Monitor's 'validation' parameter. Added to be compatible with the InputConnector class.

Overrides:
fwdGet in class InputSwitchSynapse
Returns:
neural.engine.Pattern

check

public java.util.TreeSet check()
Description copied from class: InputSwitchSynapse
Check that parameters are set correctly.

Specified by:
check in interface NeuralElement
Overrides:
check in class InputSwitchSynapse
Returns:
validation errors.
See Also:
Synapse

getTrainingSet

public StreamInputSynapse getTrainingSet()
Getter for property trainingSet. Added for XML serialization

Returns:
Value of property trainingSet.

setTrainingSet

public void setTrainingSet(StreamInputSynapse trainingSet)
Setter for property trainingSet. Added for XML serialization

Parameters:
trainingSet - New value of property trainingSet.

getValidationSet

public StreamInputSynapse getValidationSet()
Getter for property validationSet. Added for XML serialization

Returns:
Value of property validationSet.

setValidationSet

public void setValidationSet(StreamInputSynapse validationSet)
Setter for property validationSet. Added for XML serialization

Parameters:
validationSet - New value of property validationSet.


Submit Feedback to pmarrone@users.sourceforge.net