The Encog Project

org.encog.neural.networks.structure
Class NetworkCODEC

java.lang.Object
  extended by org.encog.neural.networks.structure.NetworkCODEC

public final class NetworkCODEC
extends java.lang.Object

This class will extract the "long term memory" of a neural network, that is the weights and threshold values into an array. This array can be used to view the neural network as a linear array of doubles. These values can then be modified and copied back into the neural network. This is very useful for simulated annealing, as well as genetic algorithms.

Author:
jheaton

Method Summary
static void arrayToNetwork(double[] array, BasicNetwork network)
          Use an array to populate the memory of the neural network.
static boolean equals(BasicNetwork network1, BasicNetwork network2, int precision)
          Determine if the two neural networks are equal.
static double[] networkToArray(BasicNetwork network)
          Convert to an array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

arrayToNetwork

public static void arrayToNetwork(double[] array,
                                  BasicNetwork network)
Use an array to populate the memory of the neural network.

Parameters:
array - An array of doubles.
network - The network to encode.

equals

public static boolean equals(BasicNetwork network1,
                             BasicNetwork network2,
                             int precision)
Determine if the two neural networks are equal.

Parameters:
network1 - The first network.
network2 - The second network.
precision - How many decimal places to check.
Returns:
True if the two networks are equal.

networkToArray

public static double[] networkToArray(BasicNetwork network)
Convert to an array. This is used with some training algorithms that require that the "memory" of the neuron(the weight and threshold values) be expressed as a linear array.

Parameters:
network - The network to encode.
Returns:
The memory of the neuron.

The Encog Project