|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.joone.engine.Synapse
org.joone.engine.learning.AbstractTeacherSynapse
public abstract class AbstractTeacherSynapse
This class provides a framework to extend in order to implement various teachers, just by overriding or implementing certain functions different functionality can easily implemented.
| Field Summary | |
|---|---|
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 static ILogger |
log
Logger |
| 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 | |
|---|---|
AbstractTeacherSynapse()
Creates a new instance of AbstractTeacherSynapse |
|
| Method Summary | |
|---|---|
protected void |
backward(double[] pattern)
Funzione di TRAIN dell'elemento. |
protected abstract double |
calculateError(double aDesired,
double anOutput,
int anIndex)
Calculates the error to be backpropaged for a single output neuron. |
protected 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. |
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. |
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()
|
| Methods inherited from class org.joone.engine.Synapse |
|---|
addNoise, canCountSteps, getFwdLock, getIgnoreBefore, getInputDimension, getLearner, getLearningRate, getMomentum, getMonitor, getName, getOutputDimension, getRevLock, getWeights, initLearner, InspectableTitle, Inspections, isEnabled, isInputFull, isLoopBack, isOutputFull, randomize, setEnabled, setIgnoreBefore, setInputFull, setLearningRate, setLoopBack, setMomentum, setName, setOutputDimension, setOutputFull, setWeights |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final ILogger log
protected StreamInputSynapse desired
protected transient Fifo error
| Constructor Detail |
|---|
public AbstractTeacherSynapse()
| Method Detail |
|---|
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)
Synapse
backward in class Synapsepattern - double[] - pattern di input sul quale applicare la funzione di trasferimento
protected 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 Synapse
protected void setArrays(int rows,
int cols)
Synapse
setArrays in class Synapse
protected void setDimensions(int rows,
int cols)
Synapse
setDimensions in class Synapsepublic void setInputDimension(int newInputDimension)
Synapse
setInputDimension 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()
Synapse
init in interface NeuralElementinit in class Synapsepublic java.util.TreeSet check()
Synapse
check in interface NeuralElementcheck in class SynapseInputPaternListener,
OutputPaternListenerpublic void revPut(Pattern pattern)
InputPatternListener
revPut in interface InputPatternListenerrevPut in class Synapsepattern - neural.engine.Patternpublic Pattern revGet()
OutputPatternListener
revGet in interface OutputPatternListenerrevGet in class Synapsepublic void fwdPut(Pattern pattern)
OutputPatternListener
fwdPut in interface OutputPatternListenerfwdPut in class Synapsepattern - neural.engine.Patternprotected void forward(double[] pattern)
Synapse
forward in class Synapsepattern - double[] - input pattern
protected void constructErrorPattern(double[] aDesired,
double[] anOutput)
aDesired - the desired patternanOutput - the actual output pattern
protected 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 neuron
protected abstract double calculateGlobalError()
protected void epochFinished()
super.epochFinished()).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||