public abstract class AbstractTeacherSynapse extends Synapse
| Modifier and Type | Field and Description |
|---|---|
protected int |
currEpoch |
protected StreamInputSynapse |
desired
The stream from where to read the desired input.
|
protected Fifo |
error
Into this FIFO (first-in-first-out) object, the calculated error (e.g.
|
protected boolean |
lastErrorPatternReady
True if an error pattern is available
|
protected static ILogger |
log
Logger
|
protected NeuralNet |
net |
| Constructor and Description |
|---|
AbstractTeacherSynapse()
Creates a new instance of AbstractTeacherSynapse
|
AbstractTeacherSynapse(NeuralNet net) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
backward(double[] pattern)
Funzione di TRAIN dell'elemento.
|
abstract double |
calculateError(double aDesired,
double anOutput,
int anIndex)
Calculates the error to be backpropaged for a single output neuron.
|
abstract double |
calculateGlobalError()
This method is called after an epoch finished and the global error should
be calculated.
|
java.util.TreeSet |
check()
Base for check messages.
|
protected void |
constructErrorPattern(double[] aDesired,
double[] anOutput)
Constructs the error pattern that will be back-propagated.
|
protected void |
epochFinished()
This method is called to signal that an epoch has finished.
|
protected void |
forward(double[] pattern)
Recall function
|
Pattern |
fwdGet()
Here, it forwards (returns) the pushed error (in FIFO order).
|
void |
fwdPut(Pattern pattern)
Method to put a pattern forward to the next layer
|
StreamInputSynapse |
getDesired()
Gets the stream to read the desired output.
|
double[] |
getLastErrorPattern()
Return the most recently seen error pattern
|
protected int |
getSeenPatterns()
Get the value of the number of patterns seen during the current epoch.
|
protected void |
incSeenPatterns()
Increases the number of seen patterns by one.
|
void |
init()
Synapse's initialization.
|
protected boolean |
isFirstTime()
Checks whether it is the first time data is passed to this teacher or not.
|
boolean |
isLastErrorPatternReady()
See if we have an error pattern available
|
void |
netStoppedError() |
protected void |
pushError(double error,
int count)
Pushes the calculated array in the FIFO queue at the end of a
epoch, that is after all patterns have been seen.
|
protected java.lang.Object |
readResolve() |
void |
reset()
Reset the input and desired synapses
|
void |
resetInput() |
Pattern |
revGet()
Returns the error pattern coming from the next layer during the training phase
|
void |
revPut(Pattern pattern)
Method to put an error pattern backward to the previous layer
|
protected void |
setArrays(int rows,
int cols)
Insert the method's description here.
|
boolean |
setDesired(StreamInputSynapse newDesired)
Set the input data stream containing desired training data.
|
protected void |
setDimensions(int rows,
int cols)
Dimensiona l'elemento
|
protected void |
setFirstTime(boolean aValue)
Sets the first time flag (is it the first time data is forwarded to this teacher).
|
void |
setInputDimension(int newInputDimension)
Sets the input dimension of the synapse
|
void |
setMonitor(Monitor newMonitor)
Sets the Monitor object of the Teacher Synapse.
|
protected void |
setSeenPatterns(int aValue)
Set the value of the number of patterns seen during the current epoch.
|
protected void |
stopTheNet() |
addNoise, canCountSteps, fwdPattern_consume, fwdPattern_produce, getCount, getFwdLock, getIgnoreBefore, getInputDimension, getLearner, getLearningRate, getMomentum, getMonitor, getName, getOutputDimension, getRevLock, getSynapseNameSafely, getWeights, initLearner, InspectableTitle, Inspections, isEnabled, isInputFull, isLoopBack, isOutputFull, randomize, revPattern_consume, revPattern_produce, setEnabled, setIgnoreBefore, setInputFull, setLearningRate, setLoopBack, setMomentum, setName, setOutputDimension, setOutputFull, setWeights, warnLogger, warnLoggerprotected static final ILogger log
protected StreamInputSynapse desired
protected transient Fifo error
protected transient int currEpoch
protected NeuralNet net
protected boolean lastErrorPatternReady
public AbstractTeacherSynapse(NeuralNet net)
public AbstractTeacherSynapse()
protected void setFirstTime(boolean aValue)
aValue - value for the first time flag.protected boolean isFirstTime()
true if it is the first time data is passed to this teacher,
false otherwise.protected void backward(double[] pattern)
Synapseprotected void pushError(double error,
int count)
error, - the calculated error.count, - the cycle of the calculated error.protected void stopTheNet()
protected int getSeenPatterns()
protected void setSeenPatterns(int aValue)
aValue - the new value for the number of patterns seen during the
current epoch.protected void incSeenPatterns()
public Pattern fwdGet()
fwdGet in interface InputPatternListenerfwdGet in class Synapsepublic StreamInputSynapse getDesired()
public boolean setDesired(StreamInputSynapse newDesired)
newDesired - the stream from where to read the desired output.protected java.lang.Object readResolve()
readResolve in class Synapseprotected void setArrays(int rows,
int cols)
Synapseprotected void setDimensions(int rows,
int cols)
SynapsesetDimensions in class Synapsepublic void setInputDimension(int newInputDimension)
SynapsesetInputDimension in interface OutputPatternListenersetInputDimension in class SynapsenewInputDimension - intpublic void reset()
reset in interface InputPatternListenerreset in class Synapsepublic void resetInput()
public void setMonitor(Monitor newMonitor)
setMonitor in interface NeuralElementsetMonitor in class SynapsenewMonitor - neural.engine.Monitorpublic void netStoppedError()
public void init()
Synapseinit in interface NeuralElementinit in class Synapsepublic java.util.TreeSet check()
Synapsecheck in interface NeuralElementcheck in class SynapseInputPaternListener,
OutputPaternListenerpublic void revPut(Pattern pattern)
InputPatternListenerrevPut in interface InputPatternListenerrevPut in class Synapsepattern - neural.engine.Patternpublic Pattern revGet()
OutputPatternListenerrevGet in interface OutputPatternListenerrevGet in class Synapsepublic void fwdPut(Pattern pattern)
OutputPatternListenerfwdPut in interface OutputPatternListenerfwdPut in class Synapsepattern - neural.engine.Patternprotected void forward(double[] pattern)
Synapseprotected void constructErrorPattern(double[] aDesired,
double[] anOutput)
aDesired - the desired patternanOutput - the actual output patternpublic abstract double calculateError(double aDesired,
double anOutput,
int anIndex)
aDesired - the desired outputanOutput - the actual output of a single neuronanIndex - the index of the output neuronpublic abstract double calculateGlobalError()
protected void epochFinished()
super.epochFinished()).public double[] getLastErrorPattern()
public boolean isLastErrorPatternReady()
Submit Feedback to pmarrone@users.sourceforge.net