org.encog.neural.networks.structure
Class NetworkCODEC

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

public final class NetworkCODEC
extends Object

This class will extract the "long term memory" of a neural network, that is the weights and bias 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, MLMethod network)
          Use an array to populate the memory of the neural network.
static boolean equals(BasicNetwork network1, BasicNetwork network2)
          Determine if the two neural networks are equal.
static boolean equals(BasicNetwork network1, BasicNetwork network2, int precision)
          Determine if the two neural networks are equal.
static int networkSize(MLMethod network)
          Determine the network size.
static double[] networkToArray(MLMethod 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,
                                  MLMethod 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)
Determine if the two neural networks are equal. Uses exact precision required by Arrays.equals.

Parameters:
network1 - The first network.
network2 - The second network.
Returns:
True if the two networks are equal.

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.

networkSize

public static int networkSize(MLMethod network)
Determine the network size.

Parameters:
network - The network.
Returns:
The size.

networkToArray

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

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


Copyright © 2014. All Rights Reserved.