Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllActivations = []Activation{Relu, Linear, Sigmoid, Tanh, Sin, Cos, Binary, Reln, Relum, Sawtooth, Abs}
AllActivations is a list of all possible activations.
Functions ¶
func Activate ¶ added in v0.4.0
func Activate(x float64, a Activation) float64
Types ¶
type Activation ¶
type Activation int
Activation is an enum representing the different activation functions that can be used in a neural network.
const ( Relu Activation = iota Linear Sigmoid Tanh Sin Cos Binary Relum Reln Sawtooth Abs )
func (Activation) MarshalJSON ¶ added in v0.4.0
func (a Activation) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (Activation) String ¶ added in v0.4.0
func (a Activation) String() string
String returns the string representation of the activation.
func (*Activation) UnmarshalJSON ¶ added in v0.4.0
func (a *Activation) UnmarshalJSON(bs []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Agent ¶ added in v0.2.0
Agent is a container for a genotype and its fitness. The genotype can be of any type.
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is a simple counter that can be used to generate unique IDs.
func NewCounter ¶ added in v0.4.0
func NewCounter() *Counter
NewCounter creates a new counter, starting at 0.
type Forwarder ¶ added in v0.3.0
Forwarder is an interface for somthing that can take a set of inputs ([]float64) and return a set of outputs.
type GeneticDistance ¶ added in v0.2.0
GeneticDistance is an interface for calculating the genetic distance between two genotypes.
type Reproduction ¶ added in v0.4.0
type Reproduction[T any] interface { // Reproduce creates a new genotype from the two parents, where the first parent is fitter Reproduce(a, b T) T }
Reproduction is an interface for the reproduction of two parents to create a child
type Selection ¶ added in v0.4.0
type Selection[T any] interface { // SetAgents sets the agents to select from for this generation. SetAgents(agents []*Agent[T]) // Select returns an agent selected from the population. Select() *Agent[T] }
Selection is a strategy for selecting agents from a population. It acts on agents of type T.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
geno
|
|
arr
Module
|
|
floatarr
Module
|
|
neat
Module
|
|
pop
|
|
hillclimber
Module
|
|
simple
Module
|
|
speciated
Module
|
|
selec
|
|
elite
Module
|
|
tournament
Module
|