Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoParents = errors.New("NEAT crosser requires at least 1 parent") ErrTooManyParents = errors.New("NEAT crosser does not support more than 2 parents") )
Known errors
var ( ErrInvalidNumInputs = errors.New("num inputs must be greater than or equal to zero") ErrInvalidNumOutputs = errors.New("num outputs must be greater than zero") )
Errors related to the Seeder
var ( ErrMissingDistancer = errors.New("speciator requires a distancer helper") ErrNegativeThreshold = errors.New("compatibility threshold should be nonzero") )
Known errors for the speciator
Known errors
Known errors
Functions ¶
This section is empty.
Types ¶
type Compatibility ¶
type Compatibility struct {
DisableSortCheck bool
NodesCoefficient float64
BiasCoefficient float64
ActivationCoefficient float64
ConnsCoefficient float64
WeightCoefficient float64
}
Compatibility distance measurer using the methods described by Stanley
type Crosser ¶
type Crosser struct {
EnableProbability float64
DisableEqualParentCheck bool
DisableSortCheck bool
evo.Comparison
}
Crosser combines 1 or more parents to create an offspring genome.
type Distancer ¶
Distancer calculates the compatibility distance between two genomes
type Experiment ¶
type Experiment struct {
Crosser
Populator
Selector
Speciator
Transcriber
forward.Translator
evo.Searcher
evo.Mutators
// contains filtered or unexported fields
}
Experiment implements an EVO experiment with the NEAT helpers.
func NewExperiment ¶
func NewExperiment(cfg config.Configurer) (exp *Experiment)
NewExperiment creates a new NEAT experiment using the configuration. Configurations employ the maximum namespace so user can be as specific or lax (depending on depth of namespace used) as desired.
func (*Experiment) AddSubscription ¶
func (e *Experiment) AddSubscription(s evo.Subscription)
AddSubscription adds a new subscription to the experiment
func (*Experiment) Subscriptions ¶
func (e *Experiment) Subscriptions() []evo.Subscription
Subscriptions returns the subscriptions registered with this experiment.
type Populator ¶
type Populator struct {
PopulationSize int
BiasPower float64
MaxBias float64
WeightPower float64
MaxWeight float64
evo.Seeder
}
Populator provides a population to the experiment
func (Populator) Populate ¶
func (p Populator) Populate() (pop evo.Population, err error)
Populate creates a new population by creating randomised version of a seed genome.
type Seeder ¶
type Seeder struct {
NumInputs int
NumOutputs int
NumTraits int
DisconnectRate float64
OutputActivation evo.Activation
}
Seeder creates the initial population
type Selector ¶
type Selector struct {
PopulationSize int
MutateOnlyProbability float64
InterspeciesMateProbability float64
DisableContinuing bool
Elitism float64
SurvivalRate float64
DecayRate float64
evo.Comparison
// contains filtered or unexported fields
}
Selector determines which genomes continue and which become parents
type Speciator ¶
type Speciator struct {
// Properties
CompatibilityThreshold float64 // Threshold for determining if a genome is compatible with the species
CompatibilityModifier float64 // Adjustment to threshold to help achieve target
TargetSpecies int // The desired number of species
// Helper
Distancer // Calculates the distance between a genome and the species's example genome
// contains filtered or unexported fields
}
Speciator assigns genomes to the correct species, adding and removing species as necessary
func (*Speciator) Speciate ¶
func (s *Speciator) Speciate(pop *evo.Population) (err error)
Speciate the population
Source Files
¶
- crosser.go
- distancer.go
- experiment.go
- populator.go
- seeder.go
- selector.go
- speciator.go
- transcriber.go