org.joone.engine.learning
Class ComparisonSynapse

java.lang.Object
  extended by org.joone.engine.Synapse
      extended by org.joone.engine.learning.ComparisonSynapse
All Implemented Interfaces:
java.io.Serializable, InputPatternListener, Learnable, LearnableSynapse, NeuralElement, OutputPatternListener, Inspectable

public class ComparisonSynapse
extends Synapse

Final element of a neural network; it permits to compare the outcome of the neural net and the input patterns from a StreamInputSynapse connected to the 'desired' property. Used by the ComparingSynapse object.

See Also:
Serialized Form

Field Summary
protected  Fifo fifo
           
protected  boolean firstTime
           
 
Fields inherited from class org.joone.engine.Synapse
array, b_pattern, bitems, bouts, count, enabled, fwdLock, inps, items, learnable, m_batch, m_pattern, myLearner, outs, revLock
 
Constructor Summary
ComparisonSynapse()
           
 
Method Summary
protected  void backward(double[] pattern)
          Not used.
 java.util.TreeSet check()
          Base for check messages.
protected  void forward(double[] pActual)
          Recall function
 Pattern fwdGet()
          Returns the pattern coming from the previous layer during the recall phase
 void fwdPut(Pattern pattern)
          Method to put a pattern forward to the next layer
 StreamInputSynapse getDesired()
          Inserire qui la descrizione del metodo.
 int getOutputDimension()
          Returns the output dimension of the synapse.
 void init()
          Synapse's initialization.
 void netStoppedError(NeuralNetEvent e, java.lang.String error)
           
 void reset()
          reset of the input synapse
 void resetInput()
           
 Pattern revGet()
          Not used.
 void revPut(Pattern pattern)
          Not used.
protected  void setArrays(int rows, int cols)
          Not used.
 boolean setDesired(StreamInputSynapse newDesired)
          Set the input data stream containing desired training data
protected  void setDimensions(int rows, int cols)
          Not used.
 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 stopTheNet()
           
 
Methods inherited from class org.joone.engine.Synapse
addNoise, canCountSteps, fwdPattern_consume, fwdPattern_produce, getCount, getFwdLock, getIgnoreBefore, getInputDimension, getLearner, getLearningRate, getMomentum, getMonitor, getName, getRevLock, getSynapseNameSafely, getWeights, initLearner, InspectableTitle, Inspections, isEnabled, isInputFull, isLoopBack, isOutputFull, randomize, readResolve, revPattern_consume, revPattern_produce, setEnabled, setIgnoreBefore, setInputFull, setLearningRate, setLoopBack, setMomentum, setName, setOutputDimension, setOutputFull, setWeights, warnLogger, warnLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fifo

protected transient Fifo fifo

firstTime

protected transient boolean firstTime
Constructor Detail

ComparisonSynapse

public ComparisonSynapse()
Method Detail

backward

protected void backward(double[] pattern)
Not used.

Specified by:
backward in class Synapse
Parameters:
pattern - double[] - pattern di input sul quale applicare la funzione di trasferimento

forward

protected void forward(double[] pActual)
Description copied from class: Synapse
Recall function

Specified by:
forward in class Synapse
Parameters:
pActual - double[] - input pattern. THIS PATTERN CANNOT BE CHANGED

stopTheNet

protected void stopTheNet()

fwdGet

public Pattern fwdGet()
Description copied from interface: InputPatternListener
Returns the pattern coming from the previous layer during the recall phase

Specified by:
fwdGet in interface InputPatternListener
Overrides:
fwdGet in class Synapse
Returns:
neural.engine.Pattern

fwdPut

public void fwdPut(Pattern pattern)
Description copied from interface: OutputPatternListener
Method to put a pattern forward to the next layer

Specified by:
fwdPut in interface OutputPatternListener
Overrides:
fwdPut in class Synapse
Parameters:
pattern - neural.engine.Pattern

getDesired

public StreamInputSynapse getDesired()
Inserire qui la descrizione del metodo. Data di creazione: (11/04/00 1.12.04)

Returns:
neural.engine.StreamInputSynapse

revGet

public Pattern revGet()
Not used.

Specified by:
revGet in interface OutputPatternListener
Overrides:
revGet in class Synapse
Returns:
neural.engine.Pattern

revPut

public void revPut(Pattern pattern)
Not used.

Specified by:
revPut in interface InputPatternListener
Overrides:
revPut in class Synapse
Parameters:
pattern - neural.engine.Pattern

setArrays

protected void setArrays(int rows,
                         int cols)
Not used. setArrays method comment.

Specified by:
setArrays in class Synapse

setDesired

public boolean setDesired(StreamInputSynapse newDesired)
Set the input data stream containing desired training data

Parameters:
newDesired - neural.engine.StreamInputSynapse

resetInput

public void resetInput()

setDimensions

protected void setDimensions(int rows,
                             int cols)
Not used.

Specified by:
setDimensions in class Synapse

setInputDimension

public void setInputDimension(int newInputDimension)
Description copied from class: Synapse
Sets the input dimension of the synapse

Specified by:
setInputDimension in interface OutputPatternListener
Overrides:
setInputDimension in class Synapse
Parameters:
newInputDimension - int

check

public java.util.TreeSet check()
Description copied from class: Synapse
Base for check messages. Subclasses should call this method from thier own check method.

Specified by:
check in interface NeuralElement
Overrides:
check in class Synapse
Returns:
validation errors.
See Also:
InputPaternListener, OutputPaternListener

reset

public void reset()
reset of the input synapse

Specified by:
reset in interface InputPatternListener
Overrides:
reset in class Synapse

setMonitor

public void setMonitor(Monitor newMonitor)
Sets the Monitor object of the Teacher Synapse. Adds this Techer Synapse as a NeuralNetListener so that it can reset after a critical error.

Specified by:
setMonitor in interface NeuralElement
Overrides:
setMonitor in class Synapse
Parameters:
newMonitor - neural.engine.Monitor

netStoppedError

public void netStoppedError(NeuralNetEvent e,
                            java.lang.String error)

getOutputDimension

public int getOutputDimension()
Returns the output dimension of the synapse.

Specified by:
getOutputDimension in interface InputPatternListener
Specified by:
getOutputDimension in interface LearnableSynapse
Overrides:
getOutputDimension in class Synapse
Returns:
int

init

public void init()
Description copied from class: Synapse
Synapse's initialization. It needs to be invoked at the starting of the neural network It's called within the Layer.init() method

Specified by:
init in interface NeuralElement
Overrides:
init in class Synapse


Submit Feedback to pmarrone@users.sourceforge.net