|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.encog.ml.anneal.SimulatedAnnealing<UNIT_TYPE>
UNIT_TYPE
- What type of data makes up the solution.public abstract class SimulatedAnnealing<UNIT_TYPE>
Simulated annealing is a common training method. This class implements a simulated annealing algorithm that can be used both for neural networks, as well as more general cases. This class is abstract, so a more specialized simulated annealing subclass will need to be created for each intended use. This book demonstrates how to use the simulated annealing algorithm to train feedforward neural networks, as well as find a solution to the traveling salesman problem. The name and inspiration come from annealing in metallurgy, a technique involving heating and controlled cooling of a material to increase the size of its crystals and reduce their defects. The heat causes the atoms to become unstuck from their initial positions (a local minimum of the internal energy) and wander randomly through states of higher energy; the slow cooling gives them more chances of finding configurations with lower internal energy than the initial one.
Constructor Summary | |
---|---|
SimulatedAnnealing()
|
Method Summary | |
---|---|
abstract double |
calculateScore()
Subclasses should provide a method that evaluates the score for the current solution. |
abstract UNIT_TYPE[] |
getArray()
Subclasses must provide access to an array that makes up the solution. |
abstract UNIT_TYPE[] |
getArrayCopy()
Get a copy of the array. |
int |
getCycles()
|
double |
getScore()
|
double |
getStartTemperature()
|
double |
getStopTemperature()
|
double |
getTemperature()
|
boolean |
isShouldMinimize()
|
void |
iteration()
Called to perform one cycle of the annealing process. |
abstract void |
putArray(UNIT_TYPE[] array)
Store the array. |
abstract void |
randomize()
Randomize the weight matrix. |
void |
setCycles(int theCycles)
|
void |
setScore(double theScore)
Set the score. |
void |
setShouldMinimize(boolean theShouldMinimize)
Should the score be minimized. |
void |
setStartTemperature(double theStartTemperature)
|
void |
setStopTemperature(double theStopTemperature)
|
void |
setTemperature(double theTemperature)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimulatedAnnealing()
Method Detail |
---|
public abstract double calculateScore()
public abstract UNIT_TYPE[] getArray()
public abstract UNIT_TYPE[] getArrayCopy()
public int getCycles()
public double getScore()
public double getStartTemperature()
public double getStopTemperature()
public double getTemperature()
public boolean isShouldMinimize()
public void iteration()
public abstract void putArray(UNIT_TYPE[] array)
array
- The array to be stored.public abstract void randomize()
public void setCycles(int theCycles)
theCycles
- the cycles to setpublic void setScore(double theScore)
theScore
- The score to set.public void setShouldMinimize(boolean theShouldMinimize)
theShouldMinimize
- True if the score should be minimized.public void setStartTemperature(double theStartTemperature)
theStartTemperature
- the startTemperature to setpublic void setStopTemperature(double theStopTemperature)
theStopTemperature
- the stopTemperature to setpublic void setTemperature(double theTemperature)
theTemperature
- the temperature to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |