The Encog Project

org.encog.neural.networks.training.propagation
Class PropagationLevel

java.lang.Object
  extended by org.encog.neural.networks.training.propagation.PropagationLevel

public class PropagationLevel
extends java.lang.Object

Holds a level worth of information used by each of the propagation methods. A level is defined as all of the layers that feed a single next layer. In a pure feedforward neural network there will be only one layer per level. However, recurrent neural networks will contain multiple layers per level.

Author:
jheaton

Constructor Summary
PropagationLevel(PropagationUtil propagation, Layer layer)
          Construct a propagation level.
PropagationLevel(PropagationUtil propagationUtil, java.util.List<Synapse> outgoing)
          Construct a propagation level with a list of outgoing synapses.
 
Method Summary
 void accumulateThresholdGradient(int index, double value)
          Call this method to accumulate the threshold gradients during a batch.
 java.util.List<Synapse> determinePreviousSynapses()
          Determine the previous synapses from this level.
 double getActual(int index)
          Get the actual output from the specified neuron.
 double getDelta(int index)
          The deltas, or differences, between the ideal and actual.
 double[] getDeltas()
           
 double getLastThresholdGradent(int index)
          Get the specified threshold gradient, from the last iteration of training.
 java.util.List<Layer> getLayers()
           
 int getNeuronCount()
           
 java.util.List<PropagationSynapse> getOutgoing()
           
 double getThresholdDelta(int i)
          Get the specified threshold value's delta.
 double getThresholdGradient(int index)
          Get a specific threshold gradient.
 double[] getThresholdGradients()
           
 void setDelta(int index, double d)
          Set the specified delta value.
 void setLastThresholdGradient(int i, double d)
          Set the threshold gradient from the last iteration.
 void setThresholdDelta(int i, double d)
          Set the specified threshold delta.
 void setThresholdGradient(int index, double d)
          Set the specified threshold gradient to the specified value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropagationLevel

public PropagationLevel(PropagationUtil propagation,
                        Layer layer)
Construct a propagation level.

Parameters:
propagation - The propagation object that created this.
layer - The initial layer, others can be added later.

PropagationLevel

public PropagationLevel(PropagationUtil propagationUtil,
                        java.util.List<Synapse> outgoing)
Construct a propagation level with a list of outgoing synapses.

Parameters:
propagationUtil - The propagation util object to use.
outgoing - The outgoing synapses.
Method Detail

accumulateThresholdGradient

public void accumulateThresholdGradient(int index,
                                        double value)
Call this method to accumulate the threshold gradients during a batch.

Parameters:
index - The index of the gradient to modify.
value - The value to be added to the existing gradients.

determinePreviousSynapses

public java.util.List<Synapse> determinePreviousSynapses()
Determine the previous synapses from this level.

Returns:
A list of the previous synapses.

getActual

public double getActual(int index)
Get the actual output from the specified neuron.

Parameters:
index - The neuron needed.
Returns:
The actual output from that neuron.

getDelta

public double getDelta(int index)
The deltas, or differences, between the ideal and actual.

Parameters:
index - The neuron for which we seek a delta.
Returns:
The delta for the specified neuron.

getDeltas

public double[] getDeltas()
Returns:
The differences between the ideal and actual output.

getLastThresholdGradent

public double getLastThresholdGradent(int index)
Get the specified threshold gradient, from the last iteration of training.

Parameters:
index - The neuron for which this threshold gradient is needed.
Returns:
The threshold gradient for the specified neuron.

getLayers

public java.util.List<Layer> getLayers()
Returns:
All layers associated with this level.

getNeuronCount

public int getNeuronCount()
Returns:
The neuron count for this level.

getOutgoing

public java.util.List<PropagationSynapse> getOutgoing()
Returns:
The outgoing synapses for this level.

getThresholdDelta

public double getThresholdDelta(int i)
Get the specified threshold value's delta.

Parameters:
i - The threshold value needed.
Returns:
The actual value of this threshold's delta.

getThresholdGradient

public double getThresholdGradient(int index)
Get a specific threshold gradient.

Parameters:
index - The gradient index to retrieve.
Returns:
The value of the specified gradient index.

getThresholdGradients

public double[] getThresholdGradients()
Returns:
The threshold gradients.

setDelta

public void setDelta(int index,
                     double d)
Set the specified delta value.

Parameters:
index - The delta value to set.
d - The new delta value.

setLastThresholdGradient

public void setLastThresholdGradient(int i,
                                     double d)
Set the threshold gradient from the last iteration.

Parameters:
i - The index of the threshold gradient to set.
d - The new gradient value.

setThresholdDelta

public void setThresholdDelta(int i,
                              double d)
Set the specified threshold delta.

Parameters:
i - The index of the threshold delta to change.
d - The new value of the specified threshold delta.

setThresholdGradient

public void setThresholdGradient(int index,
                                 double d)
Set the specified threshold gradient to the specified value.

Parameters:
index - The gradient index to be set.
d - The new value for the specified gradient index.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
This object as a string.

The Encog Project