org.encog.neural.prune
Class PruneSelective

java.lang.Object
  extended by org.encog.neural.prune.PruneSelective

public class PruneSelective
extends Object

Prune a neural network selectively. This class allows you to either add or remove neurons from layers of a neural network. Tools

Author:
jheaton

Constructor Summary
PruneSelective(BasicNetwork network)
          Construct an object prune the neural network.
 
Method Summary
 void changeNeuronCount(Layer layer, int neuronCount)
          Change the neuron count for the network.
 double determineNeuronSignificance(Layer layer, int neuron)
          Determine the significance of the neuron.
 BasicNetwork getNetwork()
           
 void prune(Layer targetLayer, int neuron)
          Prune one of the neurons from this layer.
 void stimulateNeuron(double percent, Layer layer, int neuron)
          Stimulate the specified neuron by the specified percent.
 void stimulateWeakNeurons(Layer layer, int count, double percent)
          Stimulate weaker neurons on a layer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PruneSelective

public PruneSelective(BasicNetwork network)
Construct an object prune the neural network.

Parameters:
network - The network to prune.
Method Detail

changeNeuronCount

public void changeNeuronCount(Layer layer,
                              int neuronCount)
Change the neuron count for the network. If the count is increased then a zero-weighted neuron is added, which will not affect the output of the neural network. If the neuron count is decreased, then the weakest neuron will be removed.

Parameters:
layer - The layer to adjust.
neuronCount - The new neuron count for this layer.

determineNeuronSignificance

public double determineNeuronSignificance(Layer layer,
                                          int neuron)
Determine the significance of the neuron. The higher the return value, the more significant the neuron is.

Parameters:
layer - The layer to query.
neuron - The neuron to query.
Returns:
How significant is this neuron.

getNetwork

public BasicNetwork getNetwork()
Returns:
The network that is being processed.

prune

public void prune(Layer targetLayer,
                  int neuron)
Prune one of the neurons from this layer. Remove all entries in this weight matrix and other layers.

Parameters:
targetLayer - The neuron to prune. Zero specifies the first neuron.
neuron - The neuron to prune.

stimulateNeuron

public void stimulateNeuron(double percent,
                            Layer layer,
                            int neuron)
Stimulate the specified neuron by the specified percent. This is used to randomize the weights and bias values for weak neurons.

Parameters:
percent - The percent to randomize by.
layer - The layer that the neuron is on.
neuron - The neuron to randomize.

stimulateWeakNeurons

public void stimulateWeakNeurons(Layer layer,
                                 int count,
                                 double percent)
Stimulate weaker neurons on a layer. Find the weakest neurons and then randomize them by the specified percent.

Parameters:
layer - The layer to stimulate.
count - The number of weak neurons to stimulate.
percent - The percent to stimulate by.


Copyright © 2011. All Rights Reserved.