Skip to content

ParamEvo Class

This class is responsible for managing a set population of neural networks and breeding them in an efficient manner in order to create better performing networks' parameters (weights and biases) while following the user's given customizations.

ParamEvo .new(NeuralNetwork neuralNetworkTemp, number popSize, dictionary geneticSettings) Creates and returns the ParamEvo with the given template !neuralNetwork!, population size as !popSize!, and settings as !geneticSettings!. The settings determine how the algorithm works and is open to customization. The available setting parameters and their default values are below.
local geneticSettings = {
    ScoreFunction = nil;
    PostFunction = nil;
    HigherScoreBetter = true;

    PercentageToKill = 0.5;
    PercentageOfKilledToRandomlySpare = 0.1;

    PercentageOfBestParentToCrossover = 0.6;

    PercentageToMutate = 0.1;
    MutateBestNetwork = false;
    PercentageOfCrossedToMutate = 0.5;

    NumberOfNodesToMutate = 2;
    ParameterMutateRange = 4;
    ParameterNoiseRange = 0.01;
}

Inherited from GeneticAlgorithm:

Only unchanged and unmodified functions are listed below.

array :GetPopulation() Returns the population of networks in an array.
NeuralNetwork :GetBestNetwork() Returns the best network in the population.
void :AddNetwork(NeuralNetwork network) Adds !network! to the population.
void :ProcessGeneration(array scoreArray) Completely runs a single generation along with the pre-function and post-function.
void :ProcessGenerations(number num) Completely runs !num! number of generations with :ProcessGeneration().
dictionary :GetInfo() Returns a dictionary containing basic status info about the population.// {Generation = number, BestScore = number}