org.joone.io
Class InputSwitchSynapse
- java.lang.Object
-
- org.joone.engine.Synapse
-
- org.joone.io.StreamInputSynapse
-
- org.joone.io.InputSwitchSynapse
-
- All Implemented Interfaces:
- java.io.Serializable, InputPatternListener, Learnable, LearnableSynapse, NeuralElement, OutputPatternListener, Inspectable, InputSynapse, PlugInListener
- Direct Known Subclasses:
- LearningSwitch, MultipleInputSynapse
public class InputSwitchSynapse extends StreamInputSynapse implements java.io.Serializable
This class acts as a switch that can connect its output to one of its connected input synapses. Many input synapses can be attached to the switch calling the method addInputSynapse, but only one is attached to the output; which one is comnnected is determined by the call to the method setActiveInput, passing to it the name of the selected synapse.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description InputSwitchSynapse()The constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanaddInputSynapse(StreamInputSynapse newInput)Adds an input synapse to the switchjava.util.TreeSetcheck()Check that parameters are set correctly.voiddataChanged(PlugInEvent data)This method is called by plug-ins whenever data is changed.PatternfwdGet()Returns the pattern coming from the previous layer during the recall phasePatternfwdGet(InputConnector conn)Returns the pattern coming from the previous layer during the recall phase.java.lang.StringgetActiveInput()Returns the name of the actual connected input synapsejava.lang.StringgetAdvancedColumnSelector()java.util.VectorgetAllInputs()java.lang.StringgetDefaultInput()Returns the name of the default input synapse that is connected when the reset method is calledintgetFirstRow()java.util.CollectiongetInspections()intgetLastRow()MonitorgetMonitor()Returns the monitorjava.lang.StringgetName()Returns the name of the input synapseintgetOutputDimension()Returns the dimension of the input synapseConverterPlugIngetPlugIn()Gets the attached ConverterPlugin, if anyvoidgotoFirstLine()voidgotoLine(int numLine)Point to the indicated line into the input streamvoidinit()Synapse's initialization.booleanisBuffered()Returns if the input synapse is buffered (10/04/00 23.11.30)booleanisEOF()Returns if reached the EOF (10/04/00 23.16.20)booleanisStepCounter()Returns if this input layer is an active counter of the steps.intnumColumns()voidreadAll()voidremoveAllInputs()booleanremoveInputSynapse(java.lang.String inputName)Removes an input synapse from the switchvoidreset()reset the state of the input synapsevoidresetInput()Reset the input stream to read its content againvoidresetSwitch()Resets the switch, connecting the default synapse to the outputvoidrevPut(Pattern pattern)Method to put an error pattern backward to the previous layervoidsetActiveInput(java.lang.String newActiveInput)Sets the input synapse connected to the outputvoidsetAllInputs(java.util.Vector inps)voidsetBuffered(boolean newBuffered)Sets the buffer-mode for this input synapse.voidsetDecimalPoint(char dp)voidsetDefaultInput(java.lang.String newDefaultInput)Sets the name of the default input synapse that is connected when the reset method is calledvoidsetMonitor(Monitor newMonitor)Sets the Monitor object of the input synapsevoidsetName(java.lang.String name)Sets the name of the input synapsevoidsetOutputDimension(int newOutputDimension)Sets the dimension of the input synapsevoidsetStepCounter(boolean newStepCounter)Inserire qui la descrizione del metodo.-
Methods inherited from class org.joone.io.StreamInputSynapse
addPlugIn, addPlugInListener, getAllPlugInListeners, getCurrentRow, getDecimalPoint, getFirstCol, getInputPatterns, getInputVector, getLastCol, getMaxBufSize, getStream, InspectableTitle, Inspections, removeAllPlugIns, removePlugInListener, setAdvancedColumnSelector, setFirstCol, setFirstRow, setInputPatterns, setLastCol, setLastRow, setMaxBufSize, setPlugin, setPlugIn
-
Methods inherited from class org.joone.engine.Synapse
addNoise, canCountSteps, fwdPut, getIgnoreBefore, getInputDimension, getLearner, getLearningRate, getMomentum, getWeights, initLearner, isEnabled, isInputFull, isLoopBack, isOutputFull, randomize, revGet, setEnabled, setIgnoreBefore, setInputDimension, setInputFull, setLearningRate, setLoopBack, setMomentum, setOutputFull, setWeights
-
-
-
-
Method Detail
-
init
public void init()
Description copied from class:SynapseSynapse's initialization. It needs to be invoked at the starting of the neural network It's called within the Layer.init() method- Specified by:
initin interfaceNeuralElement- Overrides:
initin classSynapse
-
resetSwitch
public void resetSwitch()
Resets the switch, connecting the default synapse to the output
-
reset
public void reset()
Description copied from class:StreamInputSynapsereset the state of the input synapse- Specified by:
resetin interfaceInputPatternListener- Overrides:
resetin classStreamInputSynapse
-
removeInputSynapse
public boolean removeInputSynapse(java.lang.String inputName)
Removes an input synapse from the switch- Parameters:
inputName- The name of the synapse to remove- Returns:
- false if the synapse cannot be found
-
addInputSynapse
public boolean addInputSynapse(StreamInputSynapse newInput)
Adds an input synapse to the switch- Parameters:
newInput- the new input synapse
-
getActiveInput
public java.lang.String getActiveInput()
Returns the name of the actual connected input synapse- Returns:
- The name of the connected input synapse
-
setActiveInput
public void setActiveInput(java.lang.String newActiveInput)
Sets the input synapse connected to the output- Parameters:
newActiveInput- the name of the input synapse to connect
-
getDefaultInput
public java.lang.String getDefaultInput()
Returns the name of the default input synapse that is connected when the reset method is called- Returns:
- the name of the default synapse
-
setDefaultInput
public void setDefaultInput(java.lang.String newDefaultInput)
Sets the name of the default input synapse that is connected when the reset method is called- Parameters:
newDefaultInput- the name of the default input synapse
-
getName
public java.lang.String getName()
Returns the name of the input synapse- Specified by:
getNamein interfaceNeuralElement- Overrides:
getNamein classSynapse- Returns:
- <{String}>
- See Also:
Synapse.setName(java.lang.String)
-
setName
public void setName(java.lang.String name)
Sets the name of the input synapse- Specified by:
setNamein interfaceNeuralElement- Overrides:
setNamein classSynapse- Parameters:
name- String- See Also:
Synapse.getName()
-
setOutputDimension
public void setOutputDimension(int newOutputDimension)
Sets the dimension of the input synapse- Specified by:
setOutputDimensionin interfaceInputPatternListener- Overrides:
setOutputDimensionin classSynapse- Parameters:
newOutputDimension- int
-
revPut
public void revPut(Pattern pattern)
Method to put an error pattern backward to the previous layer- Specified by:
revPutin interfaceInputPatternListener- Overrides:
revPutin classStreamInputSynapse- Parameters:
pattern- neural.engine.Pattern
-
fwdGet
public Pattern fwdGet()
Returns the pattern coming from the previous layer during the recall phase- Specified by:
fwdGetin interfaceInputPatternListener- Overrides:
fwdGetin classStreamInputSynapse- Returns:
- neural.engine.Pattern
-
fwdGet
public Pattern fwdGet(InputConnector conn)
Returns the pattern coming from the previous layer during the recall phase. This method is called by the InputConnector class- Overrides:
fwdGetin classStreamInputSynapse- Returns:
- neural.engine.Pattern
-
getOutputDimension
public int getOutputDimension()
Returns the dimension of the input synapse- Specified by:
getOutputDimensionin interfaceInputPatternListener- Specified by:
getOutputDimensionin interfaceLearnableSynapse- Overrides:
getOutputDimensionin classSynapse- Returns:
- int
-
getMonitor
public Monitor getMonitor()
Returns the monitor- Specified by:
getMonitorin interfaceLearnable- Specified by:
getMonitorin interfaceNeuralElement- Overrides:
getMonitorin classSynapse- Returns:
- <{Monitor}>
-
setMonitor
public void setMonitor(Monitor newMonitor)
Sets the Monitor object of the input synapse- Specified by:
setMonitorin interfaceNeuralElement- Overrides:
setMonitorin classSynapse- Parameters:
newMonitor- org.joone.engine.Monitor
-
getAllInputs
public java.util.Vector getAllInputs()
-
setAllInputs
public void setAllInputs(java.util.Vector inps)
-
resetInput
public void resetInput()
Description copied from class:StreamInputSynapseReset the input stream to read its content again- Specified by:
resetInputin interfaceInputSynapse- Overrides:
resetInputin classStreamInputSynapse
-
setStepCounter
public void setStepCounter(boolean newStepCounter)
Description copied from class:StreamInputSynapseInserire qui la descrizione del metodo. Data di creazione: (10/04/00 23.23.26)- Specified by:
setStepCounterin interfaceInputSynapse- Overrides:
setStepCounterin classStreamInputSynapse- Parameters:
newStepCounter- boolean
-
gotoLine
public void gotoLine(int numLine) throws java.io.IOExceptionPoint to the indicated line into the input stream- Specified by:
gotoLinein interfaceInputSynapse- Overrides:
gotoLinein classStreamInputSynapse- Throws:
java.io.IOException
-
dataChanged
public void dataChanged(PlugInEvent data)
Description copied from interface:PlugInListenerThis method is called by plug-ins whenever data is changed.- Specified by:
dataChangedin interfacePlugInListener- Overrides:
dataChangedin classStreamInputSynapse- Parameters:
data- the event that is send, i.e. the event indicating that the data is changed.
-
setDecimalPoint
public void setDecimalPoint(char dp)
- Specified by:
setDecimalPointin interfaceInputSynapse- Overrides:
setDecimalPointin classStreamInputSynapse
-
isEOF
public boolean isEOF()
Returns if reached the EOF (10/04/00 23.16.20)- Specified by:
isEOFin interfaceInputSynapse- Overrides:
isEOFin classStreamInputSynapse- Returns:
- boolean
-
readAll
public void readAll()
- Specified by:
readAllin interfaceInputSynapse- Overrides:
readAllin classStreamInputSynapse
-
setBuffered
public void setBuffered(boolean newBuffered)
Description copied from class:StreamInputSynapseSets the buffer-mode for this input synapse.- Specified by:
setBufferedin interfaceInputSynapse- Overrides:
setBufferedin classStreamInputSynapse- Parameters:
newBuffered- boolean
-
isBuffered
public boolean isBuffered()
Returns if the input synapse is buffered (10/04/00 23.11.30)- Specified by:
isBufferedin interfaceInputSynapse- Overrides:
isBufferedin classStreamInputSynapse- Returns:
- boolean
-
getPlugIn
public ConverterPlugIn getPlugIn()
Description copied from class:StreamInputSynapseGets the attached ConverterPlugin, if any- Overrides:
getPlugInin classStreamInputSynapse- Returns:
- neural.engine.ConverterPlugIn
-
isStepCounter
public boolean isStepCounter()
Returns if this input layer is an active counter of the steps. Warning: in a neural net there can be only one StepCounter element! (10/04/00 23.23.26)- Specified by:
isStepCounterin interfaceInputSynapse- Overrides:
isStepCounterin classStreamInputSynapse- Returns:
- boolean
-
gotoFirstLine
public void gotoFirstLine() throws java.io.IOException- Specified by:
gotoFirstLinein interfaceInputSynapse- Overrides:
gotoFirstLinein classStreamInputSynapse- Throws:
java.io.IOException
-
removeAllInputs
public void removeAllInputs()
-
check
public java.util.TreeSet check()
Check that parameters are set correctly.- Specified by:
checkin interfaceNeuralElement- Overrides:
checkin classStreamInputSynapse- Returns:
- validation errors.
- See Also:
Synapse
-
getFirstRow
public int getFirstRow()
- Specified by:
getFirstRowin interfaceInputSynapse- Overrides:
getFirstRowin classStreamInputSynapse- Returns:
- int
-
getLastRow
public int getLastRow()
- Specified by:
getLastRowin interfaceInputSynapse- Overrides:
getLastRowin classStreamInputSynapse- Returns:
- int
-
getInspections
public java.util.Collection getInspections()
-
numColumns
public int numColumns()
- Overrides:
numColumnsin classStreamInputSynapse
-
getAdvancedColumnSelector
public java.lang.String getAdvancedColumnSelector()
- Overrides:
getAdvancedColumnSelectorin classStreamInputSynapse
-
-
DataMelt 3.0 © DataMelt by jWork.ORG