org.encog.neural.thermal
Class BoltzmannMachine
- java.lang.Object
-
- org.encog.ml.BasicML
-
- org.encog.neural.thermal.ThermalNetwork
-
- org.encog.neural.thermal.BoltzmannMachine
-
- All Implemented Interfaces:
- java.io.Serializable, MLAutoAssocation, MLInput, MLInputOutput, MLMethod, MLOutput, MLProperties, MLRegression, MLResettable
public class BoltzmannMachine extends ThermalNetwork
Implements a Boltzmann machine.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringANNEAL_CYCLESThe property for anneal cycles.static java.lang.StringRUN_CYCLESThe property for run cycles.
-
Constructor Summary
Constructors Constructor and Description BoltzmannMachine()Default constructors.BoltzmannMachine(int neuronCount)Construct a Boltzmann machine with the specified number of neurons.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description MLDatacompute(MLData input)Note: for Boltzmann networks, you will usually want to call the "run" method to compute the output.voiddecreaseTemperature(double d)Decrease the temperature by the specified amount.voidestablishEquilibrium()Run the network until thermal equilibrium is established.intgetAnnealCycles()intgetInputCount()intgetOutputCount()intgetRunCycles()doublegetTemperature()double[]getThreshold()voidrun()Run the network for all neurons present.voidrun(int i)Run the network for the specified neuron.voidsetAnnealCycles(int annealCycles)voidsetRunCycles(int runCycles)voidsetTemperature(double temperature)Set the network temperature.voidsetThreshold(double[] t)Set the thresholds.voidupdateProperties()Update any objeccts when a property changes.-
Methods inherited from class org.encog.neural.thermal.ThermalNetwork
addWeight, calculateEnergy, clear, getCurrentState, getNeuronCount, getWeight, getWeights, init, reset, reset, setCurrentState, setCurrentState, setNeuronCount, setWeight, setWeights
-
Methods inherited from class org.encog.ml.BasicML
getProperties, getPropertyDouble, getPropertyLong, getPropertyString, setProperty, setProperty, setProperty
-
-
-
-
Field Detail
-
RUN_CYCLES
public static final java.lang.String RUN_CYCLES
The property for run cycles.- See Also:
- Constant Field Values
-
ANNEAL_CYCLES
public static final java.lang.String ANNEAL_CYCLES
The property for anneal cycles.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BoltzmannMachine
public BoltzmannMachine()
Default constructors.
-
BoltzmannMachine
public BoltzmannMachine(int neuronCount)
Construct a Boltzmann machine with the specified number of neurons.- Parameters:
neuronCount- The number of neurons.
-
-
Method Detail
-
compute
public MLData compute(MLData input)
Note: for Boltzmann networks, you will usually want to call the "run" method to compute the output. This method can be used to copy the input data to the current state. A single iteration is then run, and the new current state is returned.- Parameters:
input- The input pattern.- Returns:
- The new current state.
-
decreaseTemperature
public void decreaseTemperature(double d)
Decrease the temperature by the specified amount.- Parameters:
d- The amount to decrease by.
-
establishEquilibrium
public void establishEquilibrium()
Run the network until thermal equilibrium is established.
-
getAnnealCycles
public int getAnnealCycles()
- Returns:
- the annealCycles
-
getInputCount
public int getInputCount()
- Returns:
- The input.
-
getOutputCount
public int getOutputCount()
- Returns:
- The output count.
-
getRunCycles
public int getRunCycles()
- Returns:
- the runCycles
-
getTemperature
public double getTemperature()
- Returns:
- The temperature the network is currently operating at.
-
getThreshold
public double[] getThreshold()
- Returns:
- the threshold
-
run
public void run()
Run the network for all neurons present.
-
run
public void run(int i)
Run the network for the specified neuron.- Parameters:
i- The neuron to run for.
-
setAnnealCycles
public void setAnnealCycles(int annealCycles)
- Parameters:
annealCycles- the annealCycles to set
-
setRunCycles
public void setRunCycles(int runCycles)
- Parameters:
runCycles- the runCycles to set
-
setTemperature
public void setTemperature(double temperature)
Set the network temperature.- Parameters:
temperature- The temperature to operate the network at.
-
setThreshold
public void setThreshold(double[] t)
Set the thresholds.- Parameters:
t- The thresholds.
-
updateProperties
public void updateProperties()
Update any objeccts when a property changes.- Specified by:
updatePropertiesin interfaceMLProperties- Specified by:
updatePropertiesin classBasicML
-
-
DMelt 3.0 © DataMelt by jWork.ORG