nn

package module
v0.0.0-...-f30f465 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: MIT Imports: 8 Imported by: 0

README

Go N N

Go version Go Report Card Go doc

Another neural-network implementation featuring back-propagation.

Documentation

Index

Constants

View Source
const LearningRate = 1
View Source
const MaxLayerCount = 255

Variables

View Source
var ErrEmptyLayer = errors.New("cannot create an empty layer")

ErrEmptyLayer is raised when there is an empty layer

View Source
var ErrMissingInput = errors.New("missing input data")

ErrMissingInput is raised when there is missing inputs for a network

View Source
var ErrMissingLayers = errors.New("a network needs at least 2 layers")

ErrMissingLayers is raised when there is less than 3 layers

View Source
var ErrMissingOutput = errors.New("missing output data")

ErrMissingOutput is raised when there is missing outputs for a network

View Source
var ErrNoState = errors.New("you must process a forward pass beforehand")

ErrNoState is raised when trying to apply a stateful process on an empty network (no forward pass applied)

View Source
var ErrTooMuchLayers = errors.New("too much layers")

ErrTooMuchLayers is raised when the max number of layers is reached

Functions

This section is empty.

Types

type Network

type Network struct {
	// contains filtered or unexported fields
}

func Empty

func Empty(_layers ...uint) (*Network, error)

Empty creates a new network where each argument is the number of neurons of a layer each param represents a layer, including input/output

func (*Network) Cost

func (net *Network) Cost(_expect ...float64) (float64, error)

Cost returns the cost from the given output

func (*Network) Guess

func (net *Network) Guess(_input ...float64) ([]float64, error)

Guess uses the trained network to guess output from an input

func (*Network) MarshalJSON

func (net *Network) MarshalJSON() ([]byte, error)

MarshallJSON implements the json.Marshaler interface

func (Network) Output

func (net Network) Output() ([]float64, error)

Output returns the output data (only if the network has been fed)

func (*Network) ReadFrom

func (net *Network) ReadFrom(r io.Reader) (int64, error)

ReadFrom implements the io.ReaderFrom interface

func (*Network) Train

func (net *Network) Train(_input []float64, _expect []float64) error

Train uses the trained network to train with the _input and tries to learn to guess the _expect instead

func (*Network) UnmarshalJSON

func (net *Network) UnmarshalJSON(in []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

func (*Network) WriteTo

func (net *Network) WriteTo(w io.Writer) (int64, error)

WriteTo implements the io.WriterTo interface

Jump to

Keyboard shortcuts

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