org.encog.neural.networks.training.genetic
Class TrainingSetNeuralChromosome
java.lang.Object
org.encog.solve.genetic.Chromosome<java.lang.Double>
org.encog.neural.networks.training.genetic.NeuralChromosome
org.encog.neural.networks.training.genetic.TrainingSetNeuralChromosome
- All Implemented Interfaces:
- java.lang.Comparable<Chromosome<java.lang.Double>>
public class TrainingSetNeuralChromosome
- extends NeuralChromosome
Implements a chromosome that allows a
feedforward neural network to be trained using a genetic algorithm. The
network is trained using training sets.
The chromosome for a feed forward neural network is the weight and threshold
matrix.
|
Method Summary |
void |
calculateCost()
Calculate the cost for this chromosome. |
void |
setGenes(java.lang.Double[] list)
Set all genes. |
| Methods inherited from class org.encog.solve.genetic.Chromosome |
compareTo, getCost, getGene, getGenes, getGeneticAlgorithm, mate, setCost, setGene, setGenesDirect, setGeneticAlgorithm, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TrainingSetNeuralChromosome
public TrainingSetNeuralChromosome(TrainingSetNeuralGeneticAlgorithm genetic,
BasicNetwork network)
- The constructor, takes a list of cities to set the initial "genes" to.
- Parameters:
genetic - The genetic algorithm used with this chromosome.network - The neural network to train.
calculateCost
public void calculateCost()
- Calculate the cost for this chromosome.
- Specified by:
calculateCost in class Chromosome<java.lang.Double>
setGenes
public void setGenes(java.lang.Double[] list)
- Set all genes.
- Overrides:
setGenes in class NeuralChromosome
- Parameters:
list - A list of genes.
- Throws:
NeuralNetworkException