selection

package
v0.0.0-...-b9e61c6 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeySet_IntInt

func KeySet_IntInt(m map[int]int) []int

func KeySet_Int_SlInt

func KeySet_Int_SlInt(m map[int][]int) []int

func Sample

func Sample(k, max int) (sampled []int)

Return k random integers in range 0 to max Unknown author. Found here: http://play.golang.org/p/QH3_U3oiNL

Types

type DeterministicTournament

type DeterministicTournament struct {
	TournamentSize   int
	ParentProportion int
}

func (DeterministicTournament) GetParentProportion

func (dts DeterministicTournament) GetParentProportion() int

func (DeterministicTournament) Select

type Greedy

type Greedy struct {
	ParentProportion int
}

func (Greedy) GetParentProportion

func (gs Greedy) GetParentProportion() int

func (Greedy) Select

func (gs Greedy) Select(p *pop.Population) []pop.Individual

I'll be honest, I don't know what 'greed' is supposed to mean in this exact circumstance of evolutionary selection. I saw it referenced once. I'm assuming here that it means picking the top x members of the population where x is the proportion of members who are parents in the new generation, so that's what this is.

type Method

type Method interface {
	Select(p *pop.Population) []pop.Individual
	GetParentProportion() int
}

type Probabilistic

type Probabilistic struct {
	ParentProportion int
	Power            float64
}

func (Probabilistic) GetParentProportion

func (ps Probabilistic) GetParentProportion() int

func (Probabilistic) Select

func (ps Probabilistic) Select(p_p *pop.Population) []pop.Individual

This specific algorithm is based on the algorithm described by Adam Liposki and Dorota Lipowska in "Roulette-wheel selection via stochastic acceptance" http://arxiv.org/pdf/1109.3627v2.pdf

type StochasticUniversal

type StochasticUniversal struct {
	ParentProportion int
	// Rank based doesn't do anything
	// What it would do would it would
	// take a network's weight as its
	// ranking in a sort
	RankBased bool
	Power     float64
}

func (StochasticUniversal) GetParentProportion

func (sus StochasticUniversal) GetParentProportion() int

func (StochasticUniversal) Select

func (sus StochasticUniversal) Select(p_p *pop.Population) []pop.Individual

type Tournament

type Tournament struct {
	TournamentSize int
	// 2 for 1/2, 3 for 1/3, etc
	// The remaining fraction will
	// be taken from crossover
	ParentProportion   int
	ChanceToSelectBest float64
}

func (Tournament) GetParentProportion

func (ts Tournament) GetParentProportion() int

func (Tournament) Select

func (ts Tournament) Select(p_p *pop.Population) []pop.Individual

Jump to

Keyboard shortcuts

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