Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Activation ¶
type Activation struct {
ActivationSettings
}
type ActivationSettings ¶
type ActivationSettings interface {
MutateActivationProbability() float64 // Probability that the node's activation will be mutated
}
type Classic ¶
type Classic struct { Complexify Weight Trait }
func New ¶
func New(cs ComplexifySettings, ws WeightSettings, ts TraitSettings) *Classic
type Complete ¶
type Complete struct { Phased Weight Trait Activation }
func NewComplete ¶
func NewComplete(ps PhasedSettings, cs ComplexifySettings, ns PruningSettings, ws WeightSettings, ts TraitSettings, as ActivationSettings) *Complete
func (*Complete) SetPopulation ¶
func (m *Complete) SetPopulation(p neat.Population) error
Sets the population
type Complexify ¶
type Complexify struct { ComplexifySettings // contains filtered or unexported fields }
func (*Complexify) Mutate ¶
func (m *Complexify) Mutate(g *neat.Genome) error
Mutates a genome's weights
func (*Complexify) SetContext ¶
func (m *Complexify) SetContext(x neat.Context) error
type ComplexifySettings ¶
type ComplexifySettings interface { WeightRange() float64 // The mutation range of the weight. If x, range is [-x,x] AddNodeProbability() float64 // Probablity a node will be added to the genome AddConnProbability() float64 // Probability a connection will be added to the genome HiddenActivation() neat.ActivationType // Activation type to assign to new nodes }
Complexifying mutation settings
type Phased ¶
type Phased struct { PhasedSettings // Inner mutators Complexify Pruning // contains filtered or unexported fields }
Phased Searching As an alternative to blended searching I propose the use of 'phased' searching, so called because the NEAT search switches between a complexifying phase and a simplifying(or pruning) phase.
Phased searching works as follows:
- Before the search starts proper, calculate a threshold at which the prune phase will begin. This threshold is the current mean population complexity (MPC)** plus a specified pruning phase threshold value which typically might be between 30-100 depending on the type of experiment.
- The search begins in complexifying mode and continues as traditional NEAT until the prune phase threshold is reached.
- The search now enters a prune phase. The prune phase is almost algorithmically identical to the complexifying phase, and the normal process of selecting genomes for reproduction, generating offspring, monitoring species compatibility, etc. all takes place. The difference is that the additive mutations are disabled and subtractive ones enabled in their place. In addition only asexual reproduction (with mutation) is allowed. Crossover is disabled because this can allow genes to propagate through a population, thus increasing complexity.
- During each generation of the pruning phase a reading of the MPC is taken, this will normally be seen to fall as functionally redundant structures are removed from the population. As pruning progresses the MPC will eventually reach a floor level when no more redundant structure remains in the population to be removed. Therefore once MPC has not fallen for some number of generations (this is configurable, between 10-50 works well), we can reset the next pruning phase's threshold to be the current MPC floor level + the pruning phase threshold parameter and switch into a complexifying phase. The whole process then begins again at (2).
One small modification was made to the above process, and that is to not enter prune phase unless the population fitness has not risen for some specified number of generations. Therefore if the complexity has risen past the pruning phase threshold but the population fitness is still rising then we hold off the pruning phase until the fitness stops rising.
from Colin Green (http://sharpneat.sourceforge.net/phasedsearch.html)
func NewPhased ¶
func NewPhased(ps PhasedSettings, cs ComplexifySettings, ns PruningSettings) *Phased
func (*Phased) Mutate ¶
Mutates the Genome by through complexifiying or pruning depending on current phase
func (*Phased) SetPopulation ¶
func (m *Phased) SetPopulation(p neat.Population) error
Updates the statistics of the population and determines if a phase switch is required.
type PhasedSettings ¶
type PhasedSettings interface { PruningPhaseThreshold() float64 MaxMPCAge() int MaxImprovementAge() int ImprovementType() neat.FitnessType }
Phased mutatation settings
type Pruning ¶
type Pruning struct {
PruningSettings
}
type PruningSettings ¶
type PruningSettings interface { DelNodeProbability() float64 // Probablity a node will be removed to the genome DelConnProbability() float64 // Probability a connection will be removed to the genome }
Pruning mutation settings
type Trait ¶
type Trait struct {
TraitSettings
}
type TraitSettings ¶
type TraitSettings interface { Traits() neat.Traits // Repository of traits MutateTraitProbability() float64 // Probability that the trait will be mutated ReplaceTraitProbability() float64 // Probability that the trait will be replaced MutateSettingProbability() float64 // Probability that the setting will be mutated ReplaceSettingProbability() float64 // Probability that the setting will be replaced }
type Weight ¶
type Weight struct {
WeightSettings
}