|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.encog.solve.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 cycles)
|
void |
setScore(double score)
Set the score. |
void |
setShouldMinimize(boolean shouldMinimize)
Should the score be minimized. |
void |
setStartTemperature(double startTemperature)
|
void |
setStopTemperature(double stopTemperature)
|
void |
setTemperature(double temperature)
|
| 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 void iteration()
public abstract void putArray(UNIT_TYPE[] array)
array - The array to be stored.public abstract void randomize()
public void setCycles(int cycles)
cycles - the cycles to setpublic void setScore(double score)
score - The score to set.public void setStartTemperature(double startTemperature)
startTemperature - the startTemperature to setpublic void setStopTemperature(double stopTemperature)
stopTemperature - the stopTemperature to setpublic void setTemperature(double temperature)
temperature - the temperature to setpublic boolean isShouldMinimize()
public void setShouldMinimize(boolean shouldMinimize)
shouldMinimize - True if the score should be minimized.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||