org.encog.neural.networks.structure
Class NetworkCODEC
- java.lang.Object
-
- org.encog.neural.networks.structure.NetworkCODEC
-
public final class NetworkCODEC extends java.lang.ObjectThis 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.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidarrayToNetwork(double[] array, MLMethod network)Use an array to populate the memory of the neural network.static booleanequals(BasicNetwork network1, BasicNetwork network2)Determine if the two neural networks are equal.static booleanequals(BasicNetwork network1, BasicNetwork network2, int precision)Determine if the two neural networks are equal.static intnetworkSize(MLMethod network)Determine the network size.static double[]networkToArray(MLMethod network)Convert to an array.
-
-
-
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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG