hyperneat

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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Weight int = iota
	Bias
	LEO
)

Constants for the output index

Variables

View Source
var (
	ErrMissingCppnTranscriber = errors.New("hyperneat transcriber requires a cppn transcriber")
	ErrMissingCppnTranslator  = errors.New("hyperneat transcriber requires a cppn translator")
	ErrMissingInspector       = errors.New("hyperneat transcriber requires an inspector")
	ErrTemplateNotSet         = errors.New("hyperneat template not set")
	ErrNoInputNodes           = errors.New("hyperneat template has no input nodes")
	ErrNoOutputNodes          = errors.New("hyperneat template has no output nodes")
	ErrHasExistingConns       = errors.New("hyperneat template should not have existing connections")
	ErrInvalidWeightPower     = errors.New("hyperneat weight power cannot be zero")
)

Known errors

Functions

This section is empty.

Types

type ConstantThreshold

type ConstantThreshold struct {
	Threshold float64
}

ConstantThreshold determines the weight and expression of a connection using the weight output compared against a constant threshold value

func (ConstantThreshold) WeightAndExpression

func (ct ConstantThreshold) WeightAndExpression(outputs evo.Matrix, i int, wp float64) (w float64, e float64)

WeightAndExpression returns the weight and expression values for the connection at row i of the matrix. If expression > 0, the HyperNEAT transcriber will create the connection with the given weight

type Experiment

type Experiment struct {
	neat.Experiment
	Transcriber
	Seeder
}

Experiment builds on the NEAT experiment by adding HyperNEAT specific helpers

func NewExperiment

func NewExperiment(cfg config.Configurer) (exp *Experiment)

NewExperiment creates a new Hyper-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.

type Inspector

type Inspector interface {
	WeightAndExpression(outputs evo.Matrix, idx int, weightPower float64) (w float64, e float64)
}

Inspector describes a helper that provides the weight and expression values for a connection

type LinkExpressionOutput

type LinkExpressionOutput struct{}

LinkExpressionOutput determines the weight and expression of a connection using the LEO output

func (LinkExpressionOutput) WeightAndExpression

func (LinkExpressionOutput) WeightAndExpression(outputs evo.Matrix, i int, wp float64) (w float64, e float64)

WeightAndExpression returns the weight and expression values for the connection at row i of the matrix. If expression > 0, the HyperNEAT transcriber will create the connection with the given weight

type Seeder

type Seeder struct {
	NumTraits         int
	DisconnectRate    float64
	OutputActivation  evo.Activation
	SeedLocalityLayer bool
	SeedLocalityX     bool
	SeedLocalityY     bool
	SeedLocalityZ     bool
}

Seeder creates the seed population geared towards Cppns. Each encoded substrate will have 8 inputs, one for each dimension of the source and target nodes, and 3 ouputs: output weight, output enabled check (LEO), and bias value. The bias is used for hidden and output nodes only.

func (Seeder) Seed

func (s Seeder) Seed() (g evo.Genome, err error)

Seed returns the seed genome for a HyperNEAT setup. If SeedLocality<Dim> is set to true then a node is added and connected to the appropriate inputs and the LEO output.

type Transcriber

type Transcriber struct {

	// Helpers
	CppnTranscriber evo.Transcriber
	CppnTranslator  evo.Translator
	Inspector       // used to determine the weight of a connection and if it will be expressed

	// Properties
	WeightPower      float64 // Power by which to multiply the weight's output value
	BiasPower        float64 // Power by which to multiply the weight's output value
	DisableSortCheck bool    // Speed things up by disabling sort check on encoded substrate. Use only if sure the incoming substrate is already sorted.
	// contains filtered or unexported fields
}

Transcriber decodes an encoded substrate by processing it through a Cppn

func (*Transcriber) SetTemplate

func (t *Transcriber) SetTemplate(tmpl evo.Substrate) (err error)

SetTemplate creates the inner structure of the transcriber using the supplied template.

func (Transcriber) Transcribe

func (t Transcriber) Transcribe(enc evo.Substrate) (dec evo.Substrate, err error)

Transcribe creates a cppn network from the encoded substrate and then decodes it

Jump to

Keyboard shortcuts

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