org.encog.ml.genetic
public class MLMethodGeneticAlgorithm extends BasicTraining implements MultiThreadable
Modifier and Type | Class and Description |
---|---|
class |
MLMethodGeneticAlgorithm.MLMethodGeneticAlgorithmHelper
Very simple class that implements a genetic algorithm.
|
Constructor and Description |
---|
MLMethodGeneticAlgorithm(MethodFactory phenotypeFactory,
CalculateScore calculateScore,
int populationSize)
Construct a method genetic algorithm.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canContinue() |
MLMethodGeneticAlgorithm.MLMethodGeneticAlgorithmHelper |
getGenetic() |
MLMethod |
getMethod()
Get the current best machine learning method from the training.
|
int |
getThreadCount() |
void |
iteration()
Perform one training iteration.
|
TrainingContinuation |
pause()
Pause the training to continue later.
|
void |
resume(TrainingContinuation state)
Resume training.
|
void |
setGenetic(MLMethodGeneticAlgorithm.MLMethodGeneticAlgorithmHelper genetic)
Set the genetic helper class.
|
void |
setThreadCount(int numThreads)
Set the number of threads to use.
|
addStrategy, finishTraining, getError, getImplementationType, getIteration, getStrategies, getTraining, isTrainingDone, iteration, postIteration, preIteration, setError, setIteration, setTraining
public MLMethodGeneticAlgorithm(MethodFactory phenotypeFactory, CalculateScore calculateScore, int populationSize)
phenotypeFactory
- The phenotype factory.calculateScore
- The score calculation object.populationSize
- The population size.public boolean canContinue()
canContinue
in interface MLTrain
public MLMethodGeneticAlgorithm.MLMethodGeneticAlgorithmHelper getGenetic()
public MLMethod getMethod()
public int getThreadCount()
getThreadCount
in interface MultiThreadable
public void iteration()
public TrainingContinuation pause()
public void resume(TrainingContinuation state)
public void setGenetic(MLMethodGeneticAlgorithm.MLMethodGeneticAlgorithmHelper genetic)
genetic
- The genetic helper class.public void setThreadCount(int numThreads)
MultiThreadable
setThreadCount
in interface MultiThreadable
numThreads
- The number of threads to use, or zero to
automatically determine based on core count.Copyright © 2014. All Rights Reserved.