NEATPopulation
org.encog.neural.neat

Class NEATPopulation

  • All Implemented Interfaces:
    Serializable, Population, MLError, MLInput, MLInputOutput, MLMethod, MLOutput, MLProperties, MLRegression


    public class NEATPopulationextends BasicPopulationimplements Serializable, MLError, MLRegression
    A population for a NEAT or HyperNEAT system. This population holds the genomes, substrate and other values for a NEAT or HyperNEAT network. ----------------------------------------------------------------------------- http://www.cs.ucf.edu/~kstanley/ Encog's NEAT implementation was drawn from the following three Journal Articles. For more complete BibTeX sources, see NEATNetwork.java. Evolving Neural Networks Through Augmenting Topologies Generating Large-Scale Neural Networks Through Discovering Geometric Regularities Automatic feature selection in neuroevolution
    See Also:
    Serialized Form
    • Field Detail

      • DEFAULT_SURVIVAL_RATE

        public static final double DEFAULT_SURVIVAL_RATE
        The default survival rate.
        See Also:
        Constant Field Values
      • PROPERTY_NEAT_ACTIVATION

        public static final String PROPERTY_NEAT_ACTIVATION
        The activation function to use.
        See Also:
        Constant Field Values
      • PROPERTY_POPULATION_SIZE

        public static final String PROPERTY_POPULATION_SIZE
        Property tag for the population size.
        See Also:
        Constant Field Values
      • PROPERTY_SURVIVAL_RATE

        public static final String PROPERTY_SURVIVAL_RATE
        Property tag for the survival rate.
        See Also:
        Constant Field Values
      • DEFAULT_CYCLES

        public static final int DEFAULT_CYCLES
        Default number of activation cycles.
        See Also:
        Constant Field Values
    • Constructor Detail

      • NEATPopulation

        public NEATPopulation()
        An empty constructor for serialization.
      • NEATPopulation

        public NEATPopulation(int inputCount,              int outputCount,              int populationSize)
        Construct a starting NEAT population. This does not generate the initial random population of genomes.
        Parameters:
        inputCount - The input neuron count.
        outputCount - The output neuron count.
        populationSize - The population size.
      • NEATPopulation

        public NEATPopulation(Substrate theSubstrate,              int populationSize)
        Construct a starting HyperNEAT population. This does not generate the initial random population of genomes.
        Parameters:
        theSubstrate - The substrate ID.
        populationSize -
    • Method Detail

      • clampWeight

        public static double clampWeight(double w,                 double weightRange)
        Change the weight, do not allow the weight to go out of the weight range.
        Parameters:
        w - The amount to change the weight by.
        weightRange - Specify the weight range. The range is from -weightRange to +weightRange.
        Returns:
        The new weight value.
      • assignGeneID

        public long assignGeneID()
        Returns:
        A newly generated gene id.
      • assignInnovationID

        public long assignInnovationID()
        Returns:
        A newly generated innovation id.
      • calculateError

        public double calculateError(MLDataSet data)
        Calculate the error of the ML method, given a dataset.
        Specified by:
        calculateError in interface MLError
        Parameters:
        data - The dataset.
        Returns:
        The error.
      • compute

        public MLData compute(MLData input)
        Compute regression.
        Specified by:
        compute in interface MLRegression
        Parameters:
        input - The input data.
        Returns:
        The output data.
      • getActivationCycles

        public int getActivationCycles()
        Returns:
        Get the activation cycles.
      • getGeneIDGenerate

        public GenerateID getGeneIDGenerate()
        Returns:
        the geneIDGenerate
      • getInitialConnectionDensity

        public double getInitialConnectionDensity()
        Returns:
        the initialConnectionDensity
      • getInnovationIDGenerate

        public GenerateID getInnovationIDGenerate()
        Returns:
        the innovationIDGenerate
      • getInputCount

        public int getInputCount()
        Specified by:
        getInputCount in interface MLInput
        Returns:
        The input.
      • getOutputCount

        public int getOutputCount()
        Specified by:
        getOutputCount in interface MLOutput
        Returns:
        The output count.
      • getRandomNumberFactory

        public RandomFactory getRandomNumberFactory()
        Returns:
        the randomNumberFactory
      • getSubstrate

        public Substrate getSubstrate()
        Returns:
        Returns the hyper-neat substrate.
      • getSurvivalRate

        public double getSurvivalRate()
        Returns:
        The survival rate, this is the number of genomes used to mate.
      • getWeightRange

        public double getWeightRange()
        Returns:
        the weightRange
      • isHyperNEAT

        public boolean isHyperNEAT()
        Returns:
        Returns true if this is a hyperneat population.
      • reset

        public void reset()
        Create an initial random population.
      • setActivationCycles

        public void setActivationCycles(int activationCycles)
        Set the number of activation cycles to use.
        Parameters:
        activationCycles - The number of activatino cycles to use.
      • setCODEC

        public void setCODEC(GeneticCODEC codec)
        Parameters:
        codec - the codec to set
      • setInitialConnectionDensity

        public void setInitialConnectionDensity(double initialConnectionDensity)
        Parameters:
        initialConnectionDensity - the initialConnectionDensity to set
      • setInnovations

        public void setInnovations(NEATInnovationList theInnovations)
        Set the innovation list to use.
        Parameters:
        theInnovations - The innovation list to use.
      • setInputCount

        public void setInputCount(int inputCount)
        Parameters:
        inputCount - the inputCount to set
      • setNEATActivationFunction

        public void setNEATActivationFunction(ActivationFunction af)
        Specify to use a single activation function. This is typically the case for NEAT, but not for HyperNEAT.
        Parameters:
        af - The activation function to use.
      • setOutputCount

        public void setOutputCount(int outputCount)
        Parameters:
        outputCount - the outputCount to set
      • setRandomNumberFactory

        public void setRandomNumberFactory(RandomFactory randomNumberFactory)
        Parameters:
        randomNumberFactory - the randomNumberFactory to set
      • setSubstrate

        public void setSubstrate(Substrate substrate)
        Parameters:
        substrate - the substrate to set
      • setSurvivalRate

        public void setSurvivalRate(double theSurvivalRate)
        Set the survival rate, this is the percent of the population allowed to mate.
        Parameters:
        theSurvivalRate - The survival rate.

SCaVis 1.7 © jWork.org