isberg / elm-ann / Genome

Module for doing operations on Artificial Neural Network Genomes.


type Genome

Genome represents an ANN genotype

create : Basics.Int -> Basics.Int -> Genome

Create Genome with specified number of inputs, outputs, a bias node and no hidden nodes or connections

addConnection : Basics.Int -> Basics.Int -> Basics.Float -> Genome -> Genome

Add connection between existing nodes

addNode : Basics.Int -> Basics.Int -> Genome -> Genome

Add node by replacing existing connection with a node and two connections.

modifyWeight : Basics.Int -> Basics.Int -> Basics.Float -> Genome -> Genome

modifyWeight adds the given modification to a specific connection

toString : Genome -> String

convert to string representation

toNetwork : Genome -> Network

create network from genome

mutate : Genome -> Random.Generator Mutation

mutate create a mutation generator


type Mutation
    = NoMutation
    | AddConnection Basics.Int Basics.Int Basics.Float
    | AddNode Basics.Int Basics.Int
    | ModifyWeight Basics.Int Basics.Int Basics.Float

Representing a new mutation

breed : Genome -> Genome -> Random.Generator Genome

breeds 2 genomes creating one offspring