de.htwdd.rosenkoenig.neuro.net
Class InnerLayer

java.lang.Object
  extended by de.htwdd.rosenkoenig.neuro.net.Layer
      extended by de.htwdd.rosenkoenig.neuro.net.InnerLayer

public class InnerLayer
extends Layer

This class represents all hidden layers. The name is a little misleading because due to historical reasons the output layer is of this type, too.


Field Summary
private  double[] gradient
          The array containing the gradients of all neurons of this layer.
private  Synapse inputSynapse
          This is the input synapse (i.e the connection from the previous layer).
 
Fields inherited from class de.htwdd.rosenkoenig.neuro.net.Layer
activationFunction, biased, nettoInput, neuronsThatAreNotBiasedCount, output, outputSynapse
 
Constructor Summary
InnerLayer()
          The default ctor.
InnerLayer(int numNeurons, boolean biased)
          Ctor that creates an InnerLayer with numNeurons that is biased or not.
InnerLayer(int numNeurons, boolean biased, ActivationFunction activationFunction)
          Ctor that creates a InnerLayer with numNeurons that is biased or not.
 
Method Summary
 double[] getGradient()
          Getter of the property gradient
 Synapse getInputSynapse()
          Getter of the property inputSynapse
 void initForTraining()
          Initialize the layer for training.
 void propagate()
          Propagate a pattern through the net using the output of the previous layer as input.
 void setGradient(double[] gradient)
          Setter of the property gradient
 void setInputSynapse(Synapse inputSynapse)
          Setter of the property inputSynapse
 
Methods inherited from class de.htwdd.rosenkoenig.neuro.net.Layer
getActivationFunction, getNettoInput, getNeuronsThatAreNotBiasedCount, getOutput, getOutputSynapse, getSize, isBiased, setActivationFunction, setBiased, setOutputSynapse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputSynapse

private Synapse inputSynapse
This is the input synapse (i.e the connection from the previous layer).


gradient

private double[] gradient
The array containing the gradients of all neurons of this layer.

Constructor Detail

InnerLayer

public InnerLayer()
The default ctor. Calls Layer's ctor.


InnerLayer

public InnerLayer(int numNeurons,
                  boolean biased)
Ctor that creates an InnerLayer with numNeurons that is biased or not. The activation function remains the identity function.

Parameters:
numNeurons - the number of neurons for this InnerLayer
biased - whether or not this InnerLayer is a biased one

InnerLayer

public InnerLayer(int numNeurons,
                  boolean biased,
                  ActivationFunction activationFunction)
Ctor that creates a InnerLayer with numNeurons that is biased or not. The activation function remains will be set to the activation function you specify.

Parameters:
numNeurons - the number of neurons for this InnerLayer
biased - whether or not this InnerLayer is a biased one
Method Detail

getInputSynapse

public Synapse getInputSynapse()
Getter of the property inputSynapse

Returns:
Returns the inputSynapse.

setInputSynapse

public void setInputSynapse(Synapse inputSynapse)
Setter of the property inputSynapse

Parameters:
inputSynapse - The inputSynapse to set.

propagate

public void propagate()
Propagate a pattern through the net using the output of the previous layer as input.

Specified by:
propagate in class Layer

getGradient

public double[] getGradient()
Getter of the property gradient

Returns:
Returns the gradients.

setGradient

public void setGradient(double[] gradient)
Setter of the property gradient

Parameters:
gradient - The gradients to set.

initForTraining

public final void initForTraining()
Initialize the layer for training. This implies the initialization of the inputSynapse (clear all weight changes) and the creation of a new gradient array.