mutator

package
v0.0.0-...-77f7900 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2018 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingActivations = errors.New("activation mutator requires list of possible activation functions")
)

Known errors

Functions

This section is empty.

Types

type Activation

type Activation struct {
	ReplaceActivationProbability float64
	Activations                  []evo.Activation
}

Activation is a helper that mutates the activation value of nodes

func (Activation) Mutate

func (a Activation) Mutate(g *evo.Genome) (err error)

Mutate the the activation values of the genomes based on the settings in the helper.

type Bias

type Bias struct {
	MutateBiasProbability  float64
	ReplaceBiasProbability float64
	BiasPower              float64
	MaxBias                float64
}

Bias is a helper that mutates the bias value of nodes

func (Bias) Mutate

func (b Bias) Mutate(g *evo.Genome) (err error)

Mutate the the bias values of the genomes based on the settings in the helper. In Stanley's version of NEAT, bias is a separate node type with connections to other nodes. In evo, bias is a property of the node. Effectively, though, they are the same.

type Complexify

type Complexify struct {
	AddNodeProbability float64
	AddConnProbability float64
	WeightPower        float64
	MaxWeight          float64
	BiasPower          float64
	MaxBias            float64
	HiddenActivation   evo.Activation
	DisableSortCheck   bool
}

Complexify mutates a genome by adding to its structure

func (Complexify) Mutate

func (m Complexify) Mutate(g *evo.Genome) (err error)

Mutate a genome by adding nodes or connections

type Trait

type Trait struct {
	MutateTraitProbability  float64
	ReplaceTraitProbability float64
}

Trait is a helper that mutates the trait value of nodes

func (Trait) Mutate

func (b Trait) Mutate(g *evo.Genome) (err error)

Mutate the the trait values of the genomes based on the settings in the helper.

type Weight

type Weight struct {
	MutateWeightProbability  float64 // The probability that the connection's weight will be mutated
	ReplaceWeightProbability float64 // The probability that, if being mutated, the weight will be replaced
	WeightPower              float64
	MaxWeight                float64
}

Weight mutates the genome's connection weights

func (Weight) Mutate

func (z Weight) Mutate(g *evo.Genome) (err error)

Mutate a genome by perturbing or replacing its connections' weights

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL