Documentation
¶
Index ¶
- Constants
- Variables
- func Bench()
- func Entropy(values []complex128) (entropy float64)
- func HarmonicGenomeFactory(rnd *rand.Rand) eaopt.Genome
- func Inference(name string)
- func Learn()
- type Channel
- type Harmonic
- type HarmonicGenome
- func (g *HarmonicGenome) Clone() eaopt.Genome
- func (g *HarmonicGenome) Crossover(r eaopt.Genome, rng *rand.Rand)
- func (g *HarmonicGenome) Evaluate() (float64, error)
- func (g *HarmonicGenome) Mutate(rng *rand.Rand)
- func (g *HarmonicGenome) NewHarmonicNetwork() HarmonicNetwork
- func (g *HarmonicGenome) Write(name string)
- type HarmonicNetwork
- type Message
Constants ¶
View Source
const ( NetworkSize = 7 Iterations = 10000 )
View Source
const Threshold = 8 * fixed.FixedOne
Variables ¶
View Source
var ( Notes = [...]uint8{ 60, 62, 64, 65, 67, 69, 71, } MaxEntropy = math.Log2(float64(len(Notes))) MaxMarkov = 2 * MaxEntropy MaxSpectrumEntropy = math.Log(Iterations) )
Functions ¶
func Entropy ¶
func Entropy(values []complex128) (entropy float64)
func HarmonicGenomeFactory ¶
HarmonicGenomeFactory create a new harmonic genome
Types ¶
type Channel ¶
Channel is an delayed output channel to another harmonic node
type Harmonic ¶
type Harmonic struct { Note uint8 States [2]fixed.Fixed Weights [4]fixed.Fixed Outbox []Channel Inbox []<-chan fixed.Fixed }
Harmonic is a harmonic node
type HarmonicGenome ¶
HarmonicGenome is a genome representing the parameters of a harmonic network
func ReadHarmonicGenome ¶
func ReadHarmonicGenome(name string) *HarmonicGenome
func (*HarmonicGenome) Clone ¶
func (g *HarmonicGenome) Clone() eaopt.Genome
Clone produces a copy of a harmonic genome
func (*HarmonicGenome) Crossover ¶
func (g *HarmonicGenome) Crossover(r eaopt.Genome, rng *rand.Rand)
Crossover mates two harmonic genomes
func (*HarmonicGenome) Evaluate ¶
func (g *HarmonicGenome) Evaluate() (float64, error)
Evaluate computes the fitness of the harmonic genome
func (*HarmonicGenome) Mutate ¶
func (g *HarmonicGenome) Mutate(rng *rand.Rand)
Mutate mutates the harmonic genome
func (*HarmonicGenome) NewHarmonicNetwork ¶
func (g *HarmonicGenome) NewHarmonicNetwork() HarmonicNetwork
NewHarmonicNetwork create a harmonic network for a harmonic genome
func (*HarmonicGenome) Write ¶
func (g *HarmonicGenome) Write(name string)
type HarmonicNetwork ¶
type HarmonicNetwork []Harmonic
HarmonicNetwork is a network of harmonic nodes
func (HarmonicNetwork) Step ¶
func (h HarmonicNetwork) Step(states [][]float64) (notes []uint8)
Step steps the state of the harmonic network
Click to show internal directories.
Click to hide internal directories.