|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.encog.solve.genetic.Chromosome<java.lang.Double>
org.encog.neural.networks.training.genetic.NeuralChromosome
public class NeuralChromosome
Implements a chromosome that allows a feedforward neural network to be trained using a genetic algorithm. The chromosome for a feed forward neural network is the weight and threshold matrix. This class is abstract. If you wish to train the neural network using training sets, you should use the TrainingSetNeuralChromosome class. If you wish to use a score function to train the neural network, then implement a subclass of this one that properly calculates the score. The generic type GA_TYPE specifies the GeneticAlgorithm derived class that implements the genetic algorithm that this class is to be used with.
| Field Summary | |
|---|---|
static double |
DISTORT_FACTOR
The amount of distortion to perform a mutation. |
| Constructor Summary | |
|---|---|
NeuralChromosome(NeuralGeneticAlgorithm genetic,
BasicNetwork network)
Construct a neural chromosome. |
|
| Method Summary | |
|---|---|
void |
calculateScore()
Calculate the score for this chromosome. |
BasicNetwork |
getNetwork()
|
void |
initGenes(int length)
Init the genes array. |
void |
mutate()
Mutate this chromosome randomly. |
void |
setGenes(java.lang.Double[] list)
Set all genes. |
void |
setNetwork(BasicNetwork network)
|
void |
updateGenes()
Copy the network to the genes. |
void |
updateNetwork()
Copy the genes to the network. |
| Methods inherited from class org.encog.solve.genetic.Chromosome |
|---|
compareTo, getGene, getGenes, getGeneticAlgorithm, getScore, mate, setGene, setGenesDirect, setGeneticAlgorithm, setScore, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final double DISTORT_FACTOR
| Constructor Detail |
|---|
public NeuralChromosome(NeuralGeneticAlgorithm genetic,
BasicNetwork network)
genetic - The genetic algorithm that uses this chromosome.network - The network that this chromosome is based on.| Method Detail |
|---|
public BasicNetwork getNetwork()
public void initGenes(int length)
length - The length to create.public void mutate()
mutate in class Chromosome<java.lang.Double>public void setGenes(java.lang.Double[] list)
setGenes in class Chromosome<java.lang.Double>list - A list of genes.public void setNetwork(BasicNetwork network)
network - the network to setpublic void updateGenes()
public void updateNetwork()
public void calculateScore()
calculateScore in class Chromosome<java.lang.Double>
|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||