|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.joone.engine.Synapse
public abstract class Synapse
The Synapse is the connection element between two Layer objects. Its connections are represented by weights that transport the patterns from a layer to another. These weights are modified in the learning cycles, and represent the 'memory' of the trained neural net.
Field Summary | |
---|---|
protected Matrix |
array
|
protected Pattern |
b_pattern
|
protected int |
bitems
|
protected double[] |
bouts
|
protected int |
count
|
protected boolean |
enabled
|
protected java.lang.Object |
fwdLock
|
protected double[] |
inps
|
protected int |
items
|
protected boolean |
learnable
Contains true if for the current Synapse must be used a Learner instead of a built-in learning algorithm. |
protected int |
m_batch
|
protected Pattern |
m_pattern
|
protected Learner |
myLearner
|
protected boolean |
notFirstTime
|
protected boolean |
notFirstTimeB
|
protected double[] |
outs
|
protected java.lang.Object |
revLock
|
Constructor Summary | |
---|---|
Synapse()
The constructor |
Method Summary | |
---|---|
void |
addNoise(double amplitude)
Adds a noise to the weights of the synapse |
protected abstract void |
backward(double[] pattern)
Funzione di TRAIN dell'elemento. |
boolean |
canCountSteps()
Returns TRUE if the synapse calls the method nextStep() on the Monitor object when the fwdGet() method is called |
java.util.TreeSet |
check()
Base for check messages. |
protected abstract void |
forward(double[] pattern)
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 |
protected java.lang.Object |
getFwdLock()
Getter for property fwdLock. |
int |
getIgnoreBefore()
Returns the number of the ignored cycles at beginning of each epoch. |
int |
getInputDimension()
Returns the input dimension of the synapse. |
Learner |
getLearner()
Returns the appropriate Learner object for this class depending on the Monitor.learningMode property value |
double |
getLearningRate()
Returns the value of the learning rate |
double |
getMomentum()
Returns the value of the momentum |
Monitor |
getMonitor()
Returns the Monitor object attached to the synapse |
java.lang.String |
getName()
Returns the name of the synapse |
int |
getOutputDimension()
Returns the output dimension of the synapse. |
protected java.lang.Object |
getRevLock()
Getter for property revLock. |
Matrix |
getWeights()
Getter for the internal matrix of weights |
void |
init()
Synapse's initialization. |
void |
initLearner()
Initialize the Learner object |
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 |
isEnabled()
Getter for property enabled. |
boolean |
isInputFull()
Getter for property inputFull. |
boolean |
isLoopBack()
Getter for property loopBack. |
boolean |
isOutputFull()
Getter for property outputFull. |
void |
randomize(double amplitude)
Initializes all the weigths of the synapses with random values |
protected java.lang.Object |
readResolve()
|
void |
reset()
Resets the internal state to be ready for the next run |
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 abstract void |
setArrays(int rows,
int cols)
Insert the method's description here. |
protected abstract void |
setDimensions(int rows,
int cols)
Dimensiona l'elemento |
void |
setEnabled(boolean enabled)
Setter for property enabled. |
void |
setIgnoreBefore(int newIgnoreBefore)
Sets the number of the ignored cycles at beginning of each epoch. |
void |
setInputDimension(int newInputDimension)
Sets the input dimension of the synapse |
void |
setInputFull(boolean inputFull)
Setter for property inputFull. |
void |
setLearningRate(double newLearningRate)
Sets the value of the learning rate |
void |
setLoopBack(boolean loopBack)
Setter for property loopBack. |
void |
setMomentum(double newMomentum)
Sets the value of the momentum rate |
void |
setMonitor(Monitor newMonitor)
Sets the Monitor object of the synapse |
void |
setName(java.lang.String name)
Sets the name of the synapse |
void |
setOutputDimension(int newOutputDimension)
Sets the output dimension of the synapse |
void |
setOutputFull(boolean outputFull)
Setter for property outputFull. |
void |
setWeights(Matrix newWeights)
Setter for the internal matrix of weights |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Matrix array
protected int m_batch
protected boolean enabled
protected transient double[] inps
protected transient double[] outs
protected transient double[] bouts
protected transient int items
protected transient int bitems
protected transient Pattern m_pattern
protected transient Pattern b_pattern
protected transient int count
protected transient boolean notFirstTime
protected transient boolean notFirstTimeB
protected transient Learner myLearner
protected transient volatile java.lang.Object fwdLock
protected transient volatile java.lang.Object revLock
protected boolean learnable
getLearner
Constructor Detail |
---|
public Synapse()
Method Detail |
---|
public void addNoise(double amplitude)
amplitude
- Amplitude of the noise: the value is centered around the zero.
e.g.: an amplitude = 0.2 means a noise range from -0.2 to 0.2public void randomize(double amplitude)
amplitude
- Amplitude of the random values: the value is centered around the zero.
e.g.: an amplitude = 0.2 means a values' range from -0.2 to 0.2protected abstract void backward(double[] pattern)
pattern
- double[] - pattern di input sul quale applicare la funzione di trasferimentopublic boolean canCountSteps()
protected abstract void forward(double[] pattern)
pattern
- double[] - input patternpublic Pattern fwdGet()
InputPatternListener
fwdGet
in interface InputPatternListener
public void fwdPut(Pattern pattern)
OutputPatternListener
fwdPut
in interface OutputPatternListener
pattern
- neural.engine.Patternpublic void reset()
reset
in interface InputPatternListener
public int getIgnoreBefore()
setIgnoreBefore(int)
public int getInputDimension()
getInputDimension
in interface LearnableSynapse
getInputDimension
in interface OutputPatternListener
public double getLearningRate()
getLearningRate
in interface LearnableSynapse
public double getMomentum()
getMomentum
in interface LearnableSynapse
public Monitor getMonitor()
getMonitor
in interface Learnable
getMonitor
in interface NeuralElement
public java.lang.String getName()
getName
in interface NeuralElement
setName(java.lang.String)
public int getOutputDimension()
getOutputDimension
in interface InputPatternListener
getOutputDimension
in interface LearnableSynapse
protected java.lang.Object readResolve()
public Pattern revGet()
OutputPatternListener
revGet
in interface OutputPatternListener
public void revPut(Pattern pattern)
InputPatternListener
revPut
in interface InputPatternListener
pattern
- neural.engine.Patternprotected abstract void setArrays(int rows, int cols)
protected abstract void setDimensions(int rows, int cols)
int
- rows - righeint
- cols - colonnepublic void setIgnoreBefore(int newIgnoreBefore)
newIgnoreBefore
- intSwitchSynapse
public void setInputDimension(int newInputDimension)
setInputDimension
in interface OutputPatternListener
newInputDimension
- intpublic void setLearningRate(double newLearningRate)
newLearningRate
- doublepublic void setMomentum(double newMomentum)
newMomentum
- doublepublic void setMonitor(Monitor newMonitor)
setMonitor
in interface NeuralElement
newMonitor
- neural.engine.Monitorpublic void setName(java.lang.String name)
setName
in interface NeuralElement
name
- The name of the component.getName()
public void setOutputDimension(int newOutputDimension)
setOutputDimension
in interface InputPatternListener
newOutputDimension
- intpublic boolean isEnabled()
isEnabled
in interface NeuralElement
public void setEnabled(boolean enabled)
setEnabled
in interface NeuralElement
enabled
- New value of property enabled.public boolean isLoopBack()
public void setLoopBack(boolean loopBack)
loopBack
- New value of property loopBack.public java.util.TreeSet check()
check
in interface NeuralElement
InputPaternListener
,
OutputPaternListener
public java.util.Collection Inspections()
Inspectable
Inspections
in interface Inspectable
org.joone.Inspection
public java.lang.String InspectableTitle()
Inspectable
InspectableTitle
in interface Inspectable
org.joone.InspectionFrame
public boolean isInputFull()
isInputFull
in interface InputPatternListener
public void setInputFull(boolean inputFull)
setInputFull
in interface InputPatternListener
inputFull
- New value of property inputFull.public boolean isOutputFull()
isOutputFull
in interface OutputPatternListener
public void setOutputFull(boolean outputFull)
setOutputFull
in interface OutputPatternListener
outputFull
- New value of property outputFull.public Matrix getWeights()
getWeights
in interface LearnableSynapse
public void setWeights(Matrix newWeights)
setWeights
in interface LearnableSynapse
the
- Matrix containing the 2D array of weightspublic Learner getLearner()
getLearner
in interface Learnable
Learnable.getLearner()
public void initLearner()
initLearner
in interface Learnable
Learnable.initLearner()
protected java.lang.Object getFwdLock()
protected java.lang.Object getRevLock()
public void init()
init
in interface NeuralElement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |