|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.encog.ml.genetic.GeneticAlgorithm
org.encog.neural.neat.training.NEATTraining
public class NEATTraining
Implements NEAT genetic training. NeuroEvolution of Augmenting Topologies (NEAT) is a genetic algorithm for the generation of evolving artificial neural networks. It was developed by Ken Stanley while at The University of Texas at Austin. http://www.cs.ucf.edu/~kstanley/
| Constructor Summary | |
|---|---|
NEATTraining(CalculateScore calculateScore,
int inputCount,
int outputCount,
int populationSize)
Construct a neat trainer with a new population. |
|
NEATTraining(CalculateScore calculateScore,
Population population)
Construct neat training with an existing population. |
|
| Method Summary | |
|---|---|
void |
addNeuronID(long nodeID,
List<Long> vec)
Add a neuron. |
void |
addStrategy(Strategy strategy)
Not supported, will throw an error. |
void |
adjustCompatibilityThreshold()
Adjust the species compatibility threshold. |
void |
adjustSpeciesScore()
Adjust each species score. |
boolean |
canContinue()
|
NEATGenome |
crossover(NEATGenome mom,
NEATGenome dad)
Perform the crossover. |
void |
finishTraining()
Called when training is done. |
double |
getError()
return The error for the best genome. |
TrainingImplementationType |
getImplementationType()
|
NEATInnovationList |
getInnovations()
|
int |
getInputCount()
|
int |
getIteration()
|
MLMethod |
getMethod()
Get the current best machine learning method from the training. |
int |
getOutputCount()
|
double |
getParamActivationMutationRate()
|
double |
getParamChanceAddLink()
|
double |
getParamChanceAddNode()
|
double |
getParamChanceAddRecurrentLink()
|
double |
getParamCompatibilityThreshold()
|
double |
getParamCrossoverRate()
|
double |
getParamMaxActivationPerturbation()
|
int |
getParamMaxNumberOfSpecies()
|
double |
getParamMaxPermittedNeurons()
|
double |
getParamMaxWeightPerturbation()
|
double |
getParamMutationRate()
|
int |
getParamNumAddLinkAttempts()
|
int |
getParamNumGensAllowedNoImprovement()
|
int |
getParamNumTrysToFindLoopedLink()
|
int |
getParamNumTrysToFindOldLink()
|
double |
getParamProbabilityWeightReplaced()
|
List<Strategy> |
getStrategies()
Returns an empty list, strategies are not supported. |
MLDataSet |
getTraining()
Returns null, does not use a training set, rather uses a score function. |
boolean |
isSnapshot()
|
boolean |
isTrainingDone()
|
void |
iteration()
Perform one training iteration. |
void |
iteration(int count)
Perform the specified number of training iterations. |
TrainingContinuation |
pause()
Pause the training to continue later. |
void |
resetAndKill()
Reset for an iteration. |
void |
resume(TrainingContinuation state)
Resume training. |
void |
setError(double error)
Not used. |
void |
setIteration(int iteration)
Set the current training iteration. |
void |
setParamActivationMutationRate(double paramActivationMutationRate)
Set the activation mutation rate. |
void |
setParamChanceAddLink(double paramChanceAddLink)
Set the chance to add a link. |
void |
setParamChanceAddNode(double paramChanceAddNode)
Set the chance to add a node. |
void |
setParamChanceAddRecurrentLink(double paramChanceAddRecurrentLink)
Set the chance to add a recurrent link. |
void |
setParamCompatibilityThreshold(double paramCompatibilityThreshold)
Set the compatibility threshold for species. |
void |
setParamCrossoverRate(double paramCrossoverRate)
Set the cross over rate. |
void |
setParamMaxActivationPerturbation(double paramMaxActivationPerturbation)
Set the max activation perturbation. |
void |
setParamMaxNumberOfSpecies(int paramMaxNumberOfSpecies)
Set the maximum number of species. |
void |
setParamMaxPermittedNeurons(double paramMaxPermittedNeurons)
Set the max permitted neurons. |
void |
setParamMaxWeightPerturbation(double paramMaxWeightPerturbation)
Set the max weight perturbation. |
void |
setParamMutationRate(double paramMutationRate)
Set the mutation rate. |
void |
setParamNumAddLinkAttempts(int paramNumAddLinkAttempts)
Set the number of attempts to add a link. |
void |
setParamNumGensAllowedNoImprovement(int paramNumGensAllowedNoImprovement)
Set the number of no-improvement generations allowed. |
void |
setParamNumTrysToFindLoopedLink(int paramNumTrysToFindLoopedLink)
Set the number of tries to create a looped link. |
void |
setParamNumTrysToFindOldLink(int paramNumTrysToFindOldLink)
Set the number of tries to try an old link. |
void |
setParamProbabilityWeightReplaced(double paramProbabilityWeightReplaced)
Set the probability to replace a weight. |
void |
setSnapshot(boolean snapshot)
Set if we are using snapshot mode. |
void |
sortAndRecord()
Sort the genomes. |
void |
speciateAndCalculateSpawnLevels()
Determine the species. |
NEATGenome |
tournamentSelection(int numComparisons)
Select a gene using a tournament. |
| Methods inherited from class org.encog.ml.genetic.GeneticAlgorithm |
|---|
addSpeciesMember, calculateScore, getCalculateScore, getComparator, getCrossover, getMatingPopulation, getMutate, getMutationPercent, getPercentToMate, getPopulation, getThreadCount, setCalculateScore, setComparator, setCrossover, setMatingPopulation, setMutate, setMutationPercent, setPercentToMate, setPopulation, setThreadCount |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NEATTraining(CalculateScore calculateScore,
int inputCount,
int outputCount,
int populationSize)
calculateScore - The score calculation object.inputCount - The input neuron count.outputCount - The output neuron count.populationSize - The population size.
public NEATTraining(CalculateScore calculateScore,
Population population)
calculateScore - The score object to use.population - The population to use.| Method Detail |
|---|
public void addNeuronID(long nodeID,
List<Long> vec)
nodeID - The neuron id.vec - THe list of id's used.public void addStrategy(Strategy strategy)
addStrategy in interface MLTrainstrategy - Not used.public void adjustCompatibilityThreshold()
public void adjustSpeciesScore()
public boolean canContinue()
canContinue in interface MLTrain
public NEATGenome crossover(NEATGenome mom,
NEATGenome dad)
mom - The mother.dad - The father.
public void finishTraining()
finishTraining in interface MLTrainpublic double getError()
getError in interface MLTrainpublic TrainingImplementationType getImplementationType()
getImplementationType in interface MLTrainpublic NEATInnovationList getInnovations()
public int getInputCount()
public int getIteration()
getIteration in interface MLTrainpublic MLMethod getMethod()
MLTrain
getMethod in interface MLTrainpublic int getOutputCount()
public double getParamActivationMutationRate()
public double getParamChanceAddLink()
public double getParamChanceAddNode()
public double getParamChanceAddRecurrentLink()
public double getParamCompatibilityThreshold()
public double getParamCrossoverRate()
public double getParamMaxActivationPerturbation()
public int getParamMaxNumberOfSpecies()
public double getParamMaxPermittedNeurons()
public double getParamMaxWeightPerturbation()
public double getParamMutationRate()
public int getParamNumAddLinkAttempts()
public int getParamNumGensAllowedNoImprovement()
public int getParamNumTrysToFindLoopedLink()
public int getParamNumTrysToFindOldLink()
public double getParamProbabilityWeightReplaced()
public List<Strategy> getStrategies()
getStrategies in interface MLTrainpublic MLDataSet getTraining()
getTraining in interface MLTrainpublic boolean isSnapshot()
public boolean isTrainingDone()
isTrainingDone in interface MLTrainpublic void iteration()
iteration in interface MLTrainiteration in class GeneticAlgorithmpublic void iteration(int count)
iteration in interface MLTraincount - The number of training iterations.public TrainingContinuation pause()
MLTrain
pause in interface MLTrainpublic void resetAndKill()
public void resume(TrainingContinuation state)
MLTrain
resume in interface MLTrainstate - The training continuation object to use to continue.public void setError(double error)
setError in interface MLTrainerror - Not used.public void setIteration(int iteration)
MLTrain
setIteration in interface MLTrainiteration - Iteration.public void setParamActivationMutationRate(double paramActivationMutationRate)
paramActivationMutationRate - The mutation rate.public void setParamChanceAddLink(double paramChanceAddLink)
paramChanceAddLink - The chance to add a link.public void setParamChanceAddNode(double paramChanceAddNode)
paramChanceAddNode - The chance to add a node.public void setParamChanceAddRecurrentLink(double paramChanceAddRecurrentLink)
paramChanceAddRecurrentLink - The chance to add a recurrent link.public void setParamCompatibilityThreshold(double paramCompatibilityThreshold)
paramCompatibilityThreshold - The threshold.public void setParamCrossoverRate(double paramCrossoverRate)
paramCrossoverRate - The crossover rate.public void setParamMaxActivationPerturbation(double paramMaxActivationPerturbation)
paramMaxActivationPerturbation - The max perturbation.public void setParamMaxNumberOfSpecies(int paramMaxNumberOfSpecies)
paramMaxNumberOfSpecies - The max number of species.public void setParamMaxPermittedNeurons(double paramMaxPermittedNeurons)
paramMaxPermittedNeurons - The max permitted neurons.public void setParamMaxWeightPerturbation(double paramMaxWeightPerturbation)
paramMaxWeightPerturbation - The max weight perturbation.public void setParamMutationRate(double paramMutationRate)
paramMutationRate - The mutation rate.public void setParamNumAddLinkAttempts(int paramNumAddLinkAttempts)
paramNumAddLinkAttempts - The number of attempts to add a link.public void setParamNumGensAllowedNoImprovement(int paramNumGensAllowedNoImprovement)
paramNumGensAllowedNoImprovement - The number of generations.public void setParamNumTrysToFindLoopedLink(int paramNumTrysToFindLoopedLink)
paramNumTrysToFindLoopedLink - Number of tries.public void setParamNumTrysToFindOldLink(int paramNumTrysToFindOldLink)
paramNumTrysToFindOldLink - Number of tries.public void setParamProbabilityWeightReplaced(double paramProbabilityWeightReplaced)
paramProbabilityWeightReplaced - The probability.public void setSnapshot(boolean snapshot)
snapshot - True if we are using snapshot mode.public void sortAndRecord()
public void speciateAndCalculateSpawnLevels()
public NEATGenome tournamentSelection(int numComparisons)
numComparisons - The number of compares to do.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||