The Encog Project

org.encog.neural.networks.training.genetic
Class TrainingSetNeuralChromosome

java.lang.Object
  extended by org.encog.solve.genetic.Chromosome<java.lang.Double>
      extended by org.encog.neural.networks.training.genetic.NeuralChromosome
          extended by 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.


Field Summary
 
Fields inherited from class org.encog.neural.networks.training.genetic.NeuralChromosome
DISTORT_FACTOR
 
Constructor Summary
TrainingSetNeuralChromosome(TrainingSetNeuralGeneticAlgorithm genetic, BasicNetwork network)
          The constructor, takes a list of cities to set the initial "genes" to.
 
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.neural.networks.training.genetic.NeuralChromosome
getNetwork, initGenes, mutate, setNetwork, updateGenes, updateNetwork
 
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
 

Constructor Detail

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.
Method Detail

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

The Encog Project