The Encog Project

org.encog.neural.networks.training.propagation.multi
Class GradientMap

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

public class GradientMap
extends java.lang.Object

The gradient map is used to track all of the workers and collect their gradient descents into the master neural network for training. This allows the threads to work somewhat independently and then aggregate their results at the end of each iteration. A map is built up ahead of time to allow quick access when the training is actually running.


Constructor Summary
GradientMap(PropagationUtil master, MultiPropagation mprop)
          Construct a mapping between the master network training levels and all of the workers.
 
Method Summary
 void collect()
          Collect the gradient descents from all levels and synapses and place them in the master training utility.
 java.util.Map<PropagationLevel,java.util.List<PropagationLevel>> getLevelMap()
           
 java.util.List<PropagationLevel> getLevels()
           
 java.util.Map<PropagationSynapse,java.util.List<PropagationSynapse>> getSynapseMap()
           
 java.util.List<PropagationSynapse> getSynapses()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GradientMap

public GradientMap(PropagationUtil master,
                   MultiPropagation mprop)
Construct a mapping between the master network training levels and all of the workers. This builds up the internal map that will be used to quickly collect results at the end of each training iteration.

Parameters:
master - The training util for the master network that all results are aggregated to.
mprop - The MPROP object that contains all of the workers.
Method Detail

collect

public void collect()
Collect the gradient descents from all levels and synapses and place them in the master training utility.


getLevelMap

public java.util.Map<PropagationLevel,java.util.List<PropagationLevel>> getLevelMap()
Returns:
A map between master levels and lists of corresponding worker levels.

getLevels

public java.util.List<PropagationLevel> getLevels()
Returns:
All of the master levels.

getSynapseMap

public java.util.Map<PropagationSynapse,java.util.List<PropagationSynapse>> getSynapseMap()
Returns:
A map between worker synapses and lists of corresponding worker synapses.

getSynapses

public java.util.List<PropagationSynapse> getSynapses()
Returns:
All of the master synapses.

The Encog Project