network

package
v0.0.0-...-2041dc2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Layer

type Layer struct {
	F common.Activation
	N []*Neyron
	// contains filtered or unexported fields
}

func NewLayer

func NewLayer(F common.Activation) *Layer

func (Layer) Activate

func (l Layer) Activate(in []float64) *Layer

Activate layer

func (Layer) Deltas

func (l Layer) Deltas() []float64

func (Layer) Error

func (l Layer) Error() float64

func (Layer) InitWeights

func (l Layer) InitWeights() *Layer

func (Layer) Out

func (l Layer) Out() (ret []float64)

func (Layer) SetExpectations

func (l Layer) SetExpectations(e []float64) *Layer

func (Layer) UpdateWeights

func (l Layer) UpdateWeights(speed float64, momentum float64, nextLayerDeltas []float64) *Layer

func (Layer) W

func (l Layer) W() *mat.Dense

func (Layer) WithActivation

func (l Layer) WithActivation() *Layer

func (Layer) WithDimensions

func (l Layer) WithDimensions(icount, ncount uint) *Layer

type Network

type Network struct {
	F common.Activation
	N uint
	L []*Layer
}

func NewNetwork

func NewNetwork(f common.Activation, ninputs uint) *Network

func (Network) BackPropagate

func (n Network) BackPropagate(speed float64, momentum float64, expectations []float64) *Network

func (Network) Error

func (n Network) Error(expectations []float64) float64

func (Network) Init

func (n Network) Init(withActivationNeyrons bool, layersCapacities ...uint) *Network

func (Network) Predict

func (n Network) Predict(in []float64) (out []float64)

type Neyron

type Neyron struct {
	F            common.Activation
	IsActivation bool
	// Weights
	W []float64
	D []float64
	// Inputs
	In []float64
	// Output
	Out float64
	// Expectation
	E float64
}

func NewNeyron

func NewNeyron(F common.Activation) *Neyron

func (Neyron) Activate

func (n Neyron) Activate(in []float64) *Neyron

func (Neyron) Error

func (n Neyron) Error() float64

func (Neyron) InitWeights

func (n Neyron) InitWeights() *Neyron

func (Neyron) UpdateWeights

func (n Neyron) UpdateWeights(speed float64, momentum float64, nextLayerDelta *float64) *Neyron

func (Neyron) WithInputs

func (n Neyron) WithInputs(count uint) *Neyron

Jump to

Keyboard shortcuts

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