The Encog Project

org.encog.neural.prune
Class PruneSelective

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

public class PruneSelective
extends java.lang.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.
 
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.

The Encog Project