org.encog.neural.thermal
Class ThermalNetwork
- java.lang.Object
-
- org.encog.ml.BasicML
-
- org.encog.neural.thermal.ThermalNetwork
-
- All Implemented Interfaces:
- java.io.Serializable, MLAutoAssocation, MLInput, MLInputOutput, MLMethod, MLOutput, MLProperties, MLRegression, MLResettable
- Direct Known Subclasses:
- BoltzmannMachine, HopfieldNetwork
public abstract class ThermalNetwork extends BasicML implements MLMethod, MLAutoAssocation, MLResettable
The thermal network forms the base class for Hopfield and Boltzmann machines.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ThermalNetwork()Default constructor.ThermalNetwork(int neuronCount)Construct the network with the specicified neuron count.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddWeight(int fromNeuron, int toNeuron, double value)Add to the specified weight.doublecalculateEnergy()voidclear()Clear any connection weights.BiPolarNeuralDatagetCurrentState()intgetNeuronCount()doublegetWeight(int fromNeuron, int toNeuron)Get a weight.double[]getWeights()voidinit(int neuronCount, double[] weights, double[] output)Init the network.voidreset()Reset the weights.voidreset(int seed)Reset the weights with a seed.voidsetCurrentState(BiPolarNeuralData state)voidsetCurrentState(double[] s)Set the current state.voidsetNeuronCount(int c)Set the neuron count.voidsetWeight(int fromNeuron, int toNeuron, double value)Set the weight.voidsetWeights(double[] w)Set the weight array.-
Methods inherited from class org.encog.ml.BasicML
getProperties, getPropertyDouble, getPropertyLong, getPropertyString, setProperty, setProperty, setProperty, updateProperties
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.encog.ml.MLRegression
compute
-
Methods inherited from interface org.encog.ml.MLInput
getInputCount
-
Methods inherited from interface org.encog.ml.MLOutput
getOutputCount
-
-
-
-
Constructor Detail
-
ThermalNetwork
public ThermalNetwork()
Default constructor.
-
ThermalNetwork
public ThermalNetwork(int neuronCount)
Construct the network with the specicified neuron count.- Parameters:
neuronCount- The number of neurons.
-
-
Method Detail
-
addWeight
public void addWeight(int fromNeuron, int toNeuron, double value)Add to the specified weight.- Parameters:
fromNeuron- The from neuron.toNeuron- The to neuron.value- The value to add.
-
calculateEnergy
public double calculateEnergy()
- Returns:
- Calculate the current energy for the network. The network will seek to lower this value.
-
clear
public void clear()
Clear any connection weights.
-
getCurrentState
public BiPolarNeuralData getCurrentState()
- Returns:
- The current state of the network.
-
getNeuronCount
public int getNeuronCount()
- Returns:
- Get the neuron count for the network.
-
getWeight
public double getWeight(int fromNeuron, int toNeuron)Get a weight.- Parameters:
fromNeuron- The from neuron.toNeuron- The to neuron.- Returns:
- The weight.
-
getWeights
public double[] getWeights()
- Returns:
- The weights.
-
init
public void init(int neuronCount, double[] weights, double[] output)Init the network.- Parameters:
neuronCount- The neuron count.weights- The weights.output- The toutpu
-
reset
public void reset()
Reset the weights.- Specified by:
resetin interfaceMLResettable
-
reset
public void reset(int seed)
Reset the weights with a seed.- Specified by:
resetin interfaceMLResettable- Parameters:
seed- The seed value.
-
setCurrentState
public void setCurrentState(BiPolarNeuralData state)
- Parameters:
state- The current state for the network.
-
setCurrentState
public void setCurrentState(double[] s)
Set the current state.- Parameters:
s- The current state array.
-
setNeuronCount
public void setNeuronCount(int c)
Set the neuron count.- Parameters:
c- The neuron count.
-
setWeight
public void setWeight(int fromNeuron, int toNeuron, double value)Set the weight.- Parameters:
fromNeuron- The from neuron.toNeuron- The to neuron.value- The value.
-
setWeights
public void setWeights(double[] w)
Set the weight array.- Parameters:
w- The weight array.
-
-
DMelt 3.0 © DataMelt by jWork.ORG