public abstract class StreamInputSynapse extends Synapse implements InputSynapse, Inspectable
Modifier and Type | Field and Description |
---|---|
protected int[] |
cols |
protected int |
currentRow |
protected boolean |
EOF |
protected java.util.Vector |
InputVector |
protected java.util.List |
plugInListeners
List of plug-in listeners (often input connectors).
|
protected PatternTokenizer |
tokens |
Constructor and Description |
---|
StreamInputSynapse() |
Modifier and Type | Method and Description |
---|---|
boolean |
addPlugIn(ConverterPlugIn aNewPlugIn)
Adds a plug in to the stream input synapse for data preprocessing.
|
void |
addPlugInListener(PlugInListener aListener)
Adds a plug-in lsitener to this input stream.
|
protected void |
backward(double[] pattern)
Funzione di TRAIN dell'elemento.
|
java.util.TreeSet |
check()
Check that parameters are set correctly.
|
void |
dataChanged(PlugInEvent data)
This method is called by plug-ins whenever data is changed.
|
protected void |
fireDataChanged()
Fires an event to the plug-in listeners notifying that the underlying data
has changed.
|
protected void |
forward(double[] pattern)
Recall function
|
Pattern |
fwdGet()
Returns the pattern coming from the previous layer during the recall phase
|
Pattern |
fwdGet(InputConnector conn)
This method is called by the InputConnector in order
to get the next input pattern available for that connector
|
java.lang.String |
getAdvancedColumnSelector() |
java.util.List |
getAllPlugInListeners()
Gets all the plug-in listeners.
|
int |
getCurrentRow()
Getter for property currentRow.
|
char |
getDecimalPoint()
Returns the decimal point accepted
(19/04/00 0.23.56)
|
int |
getFirstCol()
Deprecated.
|
int |
getFirstRow() |
java.util.Vector |
getInputPatterns()
Getter for property inputPatterns.
|
protected java.util.Vector |
getInputVector() |
int |
getLastCol()
Deprecated.
|
int |
getLastRow() |
int |
getMaxBufSize()
Getter for property maxBufSize.
|
ConverterPlugIn |
getPlugIn()
Gets the attached ConverterPlugin, if any
|
protected Pattern |
getStream() |
protected PatternTokenizer |
getTokens()
Getter for property tokens.
|
void |
gotoFirstLine() |
void |
gotoLine(int numLine)
Point to the indicated line into the input stream
|
protected void |
handleExceptionWithError(java.lang.Exception ex,
java.lang.String errMsg,
ILogger log) |
protected void |
handleExceptionWithWarn(java.lang.Exception ex,
java.lang.String errMsg,
ILogger logger) |
protected abstract void |
initInputStream() |
java.lang.String |
InspectableTitle()
Method to get the title to show
in the InspectionFrame tab.
|
java.util.Collection |
Inspections()
Method to get a collection of inspectable objects.
|
boolean |
isBuffered()
Checks if the input synapse is buffered or not
|
boolean |
isEOF()
Returns if reached the EOF
(10/04/00 23.16.20)
|
boolean |
isStepCounter()
Returns if this input layer is an active counter of the steps.
|
int |
numColumns() |
void |
readAll()
Reads all input values and fills the buffer
|
protected void |
readObjectBase(java.io.ObjectInputStream in) |
void |
removeAllPlugIns()
Removes (and disconnects) all (cascading) plug-ins.
|
void |
removePlugInListener(PlugInListener aListener)
Removes a plug-in listener from this input stream.
|
void |
reset()
reset the state of the input synapse
|
void |
resetInput()
Reset the input stream to read its content again
|
protected void |
restart() |
void |
revPut(Pattern array)
Method to put an error pattern backward to the previous layer
|
void |
setAdvancedColumnSelector(java.lang.String newAdvColSel) |
protected void |
setArrays(int rows,
int cols)
setArrays method.
|
void |
setBuffered(boolean aNewBuffered)
Sets the buffer-mode for this input synapse.
|
protected void |
setColList()
Sets the list of columns that must be returned as the pattern
Creation date: (18/10/2000 0.45.52)
|
void |
setDecimalPoint(char dp) |
protected void |
setDimensions(int rows,
int cols)
Dimensiona l'elemento
|
protected void |
setEOF(boolean newEOF) |
void |
setFirstCol(int firstCol)
Deprecated.
|
void |
setFirstRow(int newFirstRow)
Inserire qui la descrizione del metodo.
|
void |
setInputPatterns(java.util.Vector inputPatterns)
Setter for property inputPatterns.
|
void |
setLastCol(int lastCol)
Deprecated.
|
void |
setLastRow(int newLastRow)
Inserire qui la descrizione del metodo.
|
void |
setMaxBufSize(int maxBufSize)
Setter for property maxBufSize.
|
boolean |
setPlugin(ConverterPlugIn newPlugIn)
Deprecated.
addPlugIn(ConverterPlugIn) . If you want to replace
the plug in by setting a new plug in please use
#removeAllPlugIns(ConverterPlugIn) and addPlugIn(ConverterPlugIn) . |
void |
setPlugIn(ConverterPlugIn newPlugIn)
Added for XML serialization
**** DO NOT USE ****
Use addPlugin instead
|
void |
setStepCounter(boolean newStepCounter)
Inserire qui la descrizione del metodo.
|
protected void |
setTokens(PatternTokenizer tkn) |
protected void |
writeObjectBase(java.io.ObjectOutputStream out) |
protected Pattern |
zeroPattern() |
addNoise, canCountSteps, fwdPattern_consume, fwdPattern_produce, fwdPut, getCount, getFwdLock, getIgnoreBefore, getInputDimension, getLearner, getLearningRate, getMomentum, getMonitor, getName, getOutputDimension, getRevLock, getSynapseNameSafely, getWeights, init, initLearner, isEnabled, isInputFull, isLoopBack, isOutputFull, randomize, readResolve, revGet, revPattern_consume, revPattern_produce, setEnabled, setIgnoreBefore, setInputDimension, setInputFull, setLearningRate, setLoopBack, setMomentum, setMonitor, setName, setOutputDimension, setOutputFull, setWeights, warnLogger, warnLogger
protected transient int[] cols
protected transient java.util.Vector InputVector
protected transient int currentRow
protected transient PatternTokenizer tokens
protected transient boolean EOF
protected java.util.List plugInListeners
protected void backward(double[] pattern)
Synapse
protected void forward(double[] pattern)
Synapse
public Pattern fwdGet()
InputPatternListener
fwdGet
in interface InputPatternListener
fwdGet
in class Synapse
public char getDecimalPoint()
getDecimalPoint
in interface InputSynapse
public int getFirstRow()
getFirstRow
in interface InputSynapse
protected java.util.Vector getInputVector()
public int getLastRow()
getLastRow
in interface InputSynapse
protected Pattern getStream() throws java.io.IOException
java.io.IOException
public void gotoFirstLine() throws java.io.IOException
gotoFirstLine
in interface InputSynapse
java.io.IOException
public void gotoLine(int numLine) throws java.io.IOException
gotoLine
in interface InputSynapse
java.io.IOException
public boolean isBuffered()
isBuffered
in interface InputSynapse
true
in case the input stream is buffered, false otherwise.public boolean isEOF()
isEOF
in interface InputSynapse
public boolean isStepCounter()
isStepCounter
in interface InputSynapse
public int numColumns()
public void readAll()
readAll
in interface InputSynapse
public void revPut(Pattern array)
InputPatternListener
revPut
in interface InputPatternListener
revPut
in class Synapse
array
- neural.engine.Patternprotected void setArrays(int rows, int cols)
public void setBuffered(boolean aNewBuffered)
setBuffered
in interface InputSynapse
aNewBuffered
- true
if the input should be buffered.
false
if the input should not be buffered, the input will be
retrieved from the input source every cycle again.
Whenever any converter plug in is added, the buffer-mode will be set
to true
, regardless of the parameter's argument.
protected void setColList()
cols
- java.util.Vectorpublic void setDecimalPoint(char dp)
setDecimalPoint
in interface InputSynapse
protected void setDimensions(int rows, int cols)
Synapse
setDimensions
in class Synapse
protected void setEOF(boolean newEOF)
public void setFirstRow(int newFirstRow)
setFirstRow
in interface InputSynapse
newFirstRow
- intpublic void resetInput()
resetInput
in interface InputSynapse
protected void restart()
public void setLastRow(int newLastRow)
setLastRow
in interface InputSynapse
newLastRow
- intpublic boolean addPlugIn(ConverterPlugIn aNewPlugIn)
aNewPlugIn
- The new converter plug in to add (at the end of the list).true
when the plug in is added, false
when
the plug in is not added, e.g. in case the plug in is already added /
connected to another synapse.public void removeAllPlugIns()
public boolean setPlugin(ConverterPlugIn newPlugIn)
addPlugIn(ConverterPlugIn)
. If you want to replace
the plug in by setting a new plug in please use
#removeAllPlugIns(ConverterPlugIn)
and addPlugIn(ConverterPlugIn)
.newPlugIn
- the plug in to setpublic ConverterPlugIn getPlugIn()
public void setPlugIn(ConverterPlugIn newPlugIn)
public void setStepCounter(boolean newStepCounter)
setStepCounter
in interface InputSynapse
newStepCounter
- booleanprotected void writeObjectBase(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
protected void readObjectBase(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public int getLastCol()
getLastCol
in interface InputSynapse
public void setLastCol(int lastCol) throws java.lang.IllegalArgumentException
setLastCol
in interface InputSynapse
lastCol
- New value of property lastCol.java.lang.IllegalArgumentException
public int getFirstCol()
getFirstCol
in interface InputSynapse
public void setFirstCol(int firstCol) throws java.lang.IllegalArgumentException
setFirstCol
in interface InputSynapse
firstCol
- New value of property firstCol.java.lang.IllegalArgumentException
public java.lang.String getAdvancedColumnSelector()
public void setAdvancedColumnSelector(java.lang.String newAdvColSel)
public void dataChanged(PlugInEvent data)
PlugInListener
dataChanged
in interface PlugInListener
data
- the event that is send, i.e. the event indicating that the
data is changed.protected PatternTokenizer getTokens() throws JooneRuntimeException
JooneRuntimeException
protected void setTokens(PatternTokenizer tkn)
protected Pattern zeroPattern()
protected abstract void initInputStream() throws JooneRuntimeException
JooneRuntimeException
public java.util.TreeSet check()
check
in interface NeuralElement
check
in class Synapse
Synapse
public java.util.Collection Inspections()
Inspectable
Inspections
in interface Inspectable
Inspections
in class Synapse
org.joone.Inspection
public java.lang.String InspectableTitle()
Inspectable
InspectableTitle
in interface Inspectable
InspectableTitle
in class Synapse
org.joone.InspectionFrame
public void reset()
reset
in interface InputPatternListener
reset
in class Synapse
public int getMaxBufSize()
public void setMaxBufSize(int maxBufSize)
maxBufSize
- New value of property maxBufSize.public java.util.Vector getInputPatterns()
public void setInputPatterns(java.util.Vector inputPatterns)
inputPatterns
- New value of property inputPatterns.public Pattern fwdGet(InputConnector conn)
public int getCurrentRow()
public void addPlugInListener(PlugInListener aListener)
aListener
- the listener to addpublic void removePlugInListener(PlugInListener aListener)
aListener
- the listener to removepublic java.util.List getAllPlugInListeners()
protected void fireDataChanged()
protected void handleExceptionWithWarn(java.lang.Exception ex, java.lang.String errMsg, ILogger logger)
ex
- errMsg
- log
- protected void handleExceptionWithError(java.lang.Exception ex, java.lang.String errMsg, ILogger log)
ex
- errMsg
- log
- Submit Feedback to pmarrone@users.sourceforge.net