Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EvolveOptions

Options used to evolve network

Hierarchy

  • EvolveOptions

Index

Constructors

constructor

Properties

activations

activations: ActivationType[]

Sets allowed activations for evolution, a random activation method will be chosen from the array when activation mutation occurs.

clear

clear: boolean

If set to true, will clear the network after every activation. This is useful for evolving recurrent networks, more importantly for time series prediction.

Optional dataset

dataset: { input: number[]; output: number[] }[]

A set of input values and ideal output values to evaluate a genome's fitness with. Must be included to use NEAT.evaluate without passing a dataset.

elitism

elitism: number

Elitism of every evolution loop. Elitism in genetic algorithms.

equal

equal: boolean

If set to true when Network.crossOver runs it will assume both genomes are equally fit.

error

error: number

Set the target error. The algorithm will stop once this target error has been reached.

Optional fitnessFunction

fitnessFunction: undefined | ((population: Iterable<Network>, dataset?: { input: number[]; output: number[] }[]) => void)

A fitness function to evaluate the networks. Takes a genome, i.e. a network, and a dataset and sets the genome's score property

param

The population which needs to be evaluated

param

The dataset to test the networks.

generation

generation: number

Num of generations already done.

input

input: number

The input size of the network.

iterations

iterations: number

Set the maximum amount of iterations/generations for the algorithm to run.

Optional log

log: undefined | number

If set to n, outputs training status every n iterations. Setting log to 1 will log the status every iteration

loss

loss: lossType

Specify the loss function for the evolution, this tells a genome in the population how well it's performing. Default: methods.loss.MSE (recommended).

maxConnections

maxConnections: number

Maximum connections for a potential network

maxGates

maxGates: number

Maximum gates for a potential network

maxNodes

maxNodes: number

Maximum nodes for a potential network

mutationAmount

mutationAmount: number

If mutation occurs (randomNumber < mutationRate), sets amount of times a mutation method will be applied to the network.

mutationRate

mutationRate: number

Sets the mutation rate. If set to 0.3, 30% of the new population will be mutated.

mutations

mutations: Mutation[]

Sets allowed mutation methods for evolution, a random mutation method will be chosen from the array when mutation occurs. Optional, but default methods are non-recurrent.

output

output: number

The output size of the network.

populationSize

populationSize: number

Population size of each generation.

Optional schedule

schedule: undefined | { function: (fitness: number, error: number, iteration: number) => undefined; iterations: number }

You can schedule tasks to happen every n iterations. Paired with options.schedule.function

selection

selection: Selection

Selection method for evolution (e.g. methods.Selection.FITNESSPROPORTIONATE).

Optional template

template: Network

A template network to create the population from.

Optional training

training: TrainOptions

Train options used for training in between two evolution steps

Generated using TypeDoc