|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.encog.neural.networks.training.BasicTraining
org.encog.neural.networks.training.genetic.NeuralGeneticAlgorithm
public class NeuralGeneticAlgorithm
Implements a genetic algorithm that allows a feedforward or simple recurrent neural network to be trained using a genetic algorithm. There are essentially two ways you can make use of this class. Either way, you will need a score object. The score object tells the genetic algorithm how well suited a neural network is. If you would like to use genetic algorithms with a training set you should make use TrainingSetScore class. This score object uses a training set to score your neural network. If you would like to be more abstract, and not use a training set, you can create your own implementation of the CalculateScore method. This class can then score the networks any way that you like.
| Nested Class Summary | |
|---|---|
class |
NeuralGeneticAlgorithm.NeuralGeneticAlgorithmHelper
Very simple class that implements a genetic algorithm. |
| Constructor Summary | |
|---|---|
NeuralGeneticAlgorithm(BasicNetwork network,
Randomizer randomizer,
CalculateScore calculateScore,
int populationSize,
double mutationPercent,
double percentToMate)
Construct a neural genetic algorithm. |
|
| Method Summary | |
|---|---|
NeuralGeneticAlgorithm.NeuralGeneticAlgorithmHelper |
getGenetic()
|
BasicNetwork |
getNetwork()
Get the current best network from the training. |
void |
iteration()
Perform one training iteration. |
void |
setGenetic(NeuralGeneticAlgorithm.NeuralGeneticAlgorithmHelper genetic)
Set the genetic helper class. |
| Methods inherited from class org.encog.neural.networks.training.BasicTraining |
|---|
addStrategy, finishTraining, getCloud, getError, getIteration, getStrategies, getTraining, isTrainingDone, iteration, postIteration, preIteration, setCloud, setError, setIteration, setTraining |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NeuralGeneticAlgorithm(BasicNetwork network,
Randomizer randomizer,
CalculateScore calculateScore,
int populationSize,
double mutationPercent,
double percentToMate)
network - The network to base this on.randomizer - The randomizer used to create this initial population.calculateScore - The score calculation object.populationSize - The population size.mutationPercent - The percent of offspring to mutate.percentToMate - The percent of the population allowed to mate.| Method Detail |
|---|
public NeuralGeneticAlgorithm.NeuralGeneticAlgorithmHelper getGenetic()
public BasicNetwork getNetwork()
Train
public void iteration()
public void setGenetic(NeuralGeneticAlgorithm.NeuralGeneticAlgorithmHelper genetic)
genetic - The genetic helper class.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||