de.htwdd.rosenkoenig.neuro.net
Class Synapse

java.lang.Object
  extended by de.htwdd.rosenkoenig.neuro.net.Synapse

public class Synapse
extends java.lang.Object

This class is used to interconnect layers of neurons. It contains all connections between the two layers to be connected to improve the performance of the nets.


Field Summary
private  double[][] deltaW
          The weight change for the connection.
private  double[][] deltaWTmp
          The temporary weight change.
private  Layer inputLayer
          The input layer of the Synapse.
private  InnerLayer outputLayer
          The output layer of the Synapse.
private  double[][] weights
          This two dimensional array contains the weights for every connection between all neurons of the input layer and all neurons of the output layer.
 
Constructor Summary
Synapse()
          Default ctor.
Synapse(Layer inputLayer, InnerLayer outputLayer)
          Create a Synapse using inputLayer and outputLayer.
 
Method Summary
 double[][] getDeltaW()
          Getter of the property deltaW
 double[][] getDeltaWTmp()
          Getter of the property deltaWTmp
 Layer getInputLayer()
          Getter of the property inputLayer
 InnerLayer getOutputLayer()
          Getter of the property outputLayer
 double[][] getWeights()
          Getter of the property weights
 void initForTraining()
          Initialize the Synapse for training.
 void setDeltaW(double[][] deltaW)
          Setter of the property deltaW
 void setDeltaWTmp(double[][] deltaWTmp)
          Setter of the property deltaWTmp
 void setInputLayer(Layer inputLayer)
          Setter of the property inputLayer
 void setOutputLayer(InnerLayer outputLayer)
          Setter of the property outputLayer
 void setWeights(double[][] weights)
          Setter of the property weights
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputLayer

private Layer inputLayer
The input layer of the Synapse.


outputLayer

private InnerLayer outputLayer
The output layer of the Synapse.


weights

private double[][] weights
This two dimensional array contains the weights for every connection between all neurons of the input layer and all neurons of the output layer. first dimension: inputs
second dimension: outputs


deltaW

private double[][] deltaW
The weight change for the connection. This value is used in backpropagation to sum up the change of the weights.


deltaWTmp

private double[][] deltaWTmp
The temporary weight change. This value is useful if you do not instantly change the value of deltaW but sum up deltaWTmp instead. It is used for offline learning.

Constructor Detail

Synapse

public Synapse()
Default ctor.


Synapse

public Synapse(Layer inputLayer,
               InnerLayer outputLayer)
Create a Synapse using inputLayer and outputLayer. The weights for the connections are initialized randomly.

Parameters:
inputLayer - the input layer to use
outputLayer - the output layer to use
Method Detail

getInputLayer

public Layer getInputLayer()
Getter of the property inputLayer

Returns:
Returns the inputLayer.

setInputLayer

public void setInputLayer(Layer inputLayer)
Setter of the property inputLayer

Parameters:
inputLayer - The inputLayer to set.

getOutputLayer

public InnerLayer getOutputLayer()
Getter of the property outputLayer

Returns:
Returns the outputLayer.

setOutputLayer

public void setOutputLayer(InnerLayer outputLayer)
Setter of the property outputLayer

Parameters:
outputLayer - The outputLayer to set.

getWeights

public double[][] getWeights()
Getter of the property weights

Returns:
Returns the weights.

setWeights

public void setWeights(double[][] weights)
Setter of the property weights

Parameters:
weights - The weights to set.

getDeltaW

public double[][] getDeltaW()
Getter of the property deltaW

Returns:
Returns the deltaWs.

getDeltaWTmp

public double[][] getDeltaWTmp()
Getter of the property deltaWTmp

Returns:
Returns the deltaWTmps.

initForTraining

public final void initForTraining()
Initialize the Synapse for training. This includes the reset of the values for deltaW and deltaWTmp.^


setDeltaW

public void setDeltaW(double[][] deltaW)
Setter of the property deltaW

Parameters:
deltaW - The deltaWs to set.

setDeltaWTmp

public void setDeltaWTmp(double[][] deltaWTmp)
Setter of the property deltaWTmp

Parameters:
deltaWTmp - The deltaWTmps to set.