org.joone.engine
Class OutputSwitchSynapse
- java.lang.Object
-
- org.joone.engine.OutputSwitchSynapse
-
- All Implemented Interfaces:
- java.io.Serializable, NeuralElement, OutputPatternListener
public class OutputSwitchSynapse extends java.lang.Object implements OutputPatternListener, java.io.Serializable
This class acts as a switch that can connect its input to one of its connected output synapses. Many output synapses can be attached to the switch calling the method addOutputSynapse, but only one is attached to the input; which one is connected is determined by the call to the method setActiveOutput, passing to it the name of the selected synapse.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description OutputSwitchSynapse()The constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanaddOutputSynapse(OutputPatternListener newOutput)Adds an output synapse to the switchjava.util.TreeSetcheck()Base for check messages.voidfwdPut(Pattern pattern)Method to put a pattern forward to the next layerjava.lang.StringgetActiveOutput()Returns the name of the actual connected output synapsejava.util.VectorgetAllOutputs()java.lang.StringgetDefaultOutput()Returns the name of the default output synapse that is connected when the reset method is calledintgetInputDimension()Returns the dimension of the output synapseMonitorgetMonitor()Returns the monitorjava.lang.StringgetName()Returns the name of the output synapsevoidinit()booleanisEnabled()Getter for property enabled.booleanisOutputFull()Getter for property outputFull.booleanremoveOutputSynapse(java.lang.String outputName)Removes an output synapse from the switchvoidreset()Resets the switch, connecting the default synapse to the outputvoidresetOutput()PatternrevGet()Returns the error pattern coming from the next layer during the training phasevoidsetActiveOutput(java.lang.String newActiveOutput)Sets the output synapse connected to the inputvoidsetDefaultOutput(java.lang.String newDefaultOutput)Sets the name of the default output synapse that is connected when the reset method is calledvoidsetEnabled(boolean enabled)Setter for property enabled.voidsetInputDimension(int newInputDimension)Sets the dimension of the output synapsevoidsetMonitor(Monitor newMonitor)Sets the Monitor object of the input synapsevoidsetName(java.lang.String name)Sets the name of the output synapsevoidsetOutputFull(boolean outputFull)Setter for property outputFull.
-
-
-
Method Detail
-
reset
public void reset()
Resets the switch, connecting the default synapse to the output
-
removeOutputSynapse
public boolean removeOutputSynapse(java.lang.String outputName)
Removes an output synapse from the switch- Parameters:
inputName- The name of the synapse to remove
-
addOutputSynapse
public boolean addOutputSynapse(OutputPatternListener newOutput)
Adds an output synapse to the switch- Parameters:
newOutput- the new output synapse
-
getActiveOutput
public java.lang.String getActiveOutput()
Returns the name of the actual connected output synapse- Returns:
- The name of the connected output synapse
-
setActiveOutput
public void setActiveOutput(java.lang.String newActiveOutput)
Sets the output synapse connected to the input- Parameters:
newActiveOutput- the name of the output synapse to connect
-
getDefaultOutput
public java.lang.String getDefaultOutput()
Returns the name of the default output synapse that is connected when the reset method is called- Returns:
- the name of the default synapse
-
setDefaultOutput
public void setDefaultOutput(java.lang.String newDefaultOutput)
Sets the name of the default output synapse that is connected when the reset method is called- Parameters:
newDefaultOutput- the name of the default output synapse
-
getName
public java.lang.String getName()
Returns the name of the output synapse- Specified by:
getNamein interfaceNeuralElement- Returns:
- String
-
setName
public void setName(java.lang.String name)
Sets the name of the output synapse- Specified by:
setNamein interfaceNeuralElement- Parameters:
name- String
-
setInputDimension
public void setInputDimension(int newInputDimension)
Sets the dimension of the output synapse- Specified by:
setInputDimensionin interfaceOutputPatternListener- Parameters:
newOutputDimension- int
-
getInputDimension
public int getInputDimension()
Returns the dimension of the output synapse- Specified by:
getInputDimensionin interfaceOutputPatternListener- Returns:
- int
-
getMonitor
public Monitor getMonitor()
Returns the monitor- Specified by:
getMonitorin interfaceNeuralElement- Returns:
- org.joone.engine.Monitor
-
setMonitor
public void setMonitor(Monitor newMonitor)
Sets the Monitor object of the input synapse- Specified by:
setMonitorin interfaceNeuralElement- Parameters:
newMonitor- org.joone.engine.Monitor
-
getAllOutputs
public java.util.Vector getAllOutputs()
-
resetOutput
public void resetOutput()
-
fwdPut
public void fwdPut(Pattern pattern)
Method to put a pattern forward to the next layer- Specified by:
fwdPutin interfaceOutputPatternListener- Parameters:
pattern- neural.engine.Pattern
-
revGet
public Pattern revGet()
Returns the error pattern coming from the next layer during the training phase- Specified by:
revGetin interfaceOutputPatternListener- Returns:
- neural.engine.Pattern
-
check
public java.util.TreeSet check()
Base for check messages. Subclasses should call this method from thier own check method.- Specified by:
checkin interfaceNeuralElement- Returns:
- validation errors.
- See Also:
OutputPaternListener
-
isOutputFull
public boolean isOutputFull()
Getter for property outputFull.- Specified by:
isOutputFullin interfaceOutputPatternListener- Returns:
- Value of property outputFull.
-
setOutputFull
public void setOutputFull(boolean outputFull)
Setter for property outputFull.- Specified by:
setOutputFullin interfaceOutputPatternListener- Parameters:
outputFull- New value of property outputFull.
-
isEnabled
public boolean isEnabled()
Getter for property enabled.- Specified by:
isEnabledin interfaceNeuralElement- Returns:
- Value of property enabled.
-
setEnabled
public void setEnabled(boolean enabled)
Setter for property enabled.- Specified by:
setEnabledin interfaceNeuralElement- Parameters:
enabled- New value of property enabled.
-
init
public void init()
- Specified by:
initin interfaceNeuralElement
-
-
DataMelt 3.0 © DataMelt by jWork.ORG