Neural

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

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

Go to latest
Published: Feb 24, 2016 License: LGPL-3.0 Imports: 6 Imported by: 0

README

Back-Propagation Neural Network

Build Status GoDoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Network

type Network struct {
	NumLayers int
	Sizes     *mat64.Dense
	Weights   []*mat64.Dense
	Biases    []*mat64.Dense
	TestFunc  TestCompFunc
}

Network represents the neural network with its sizes, layers, weights, Biases and cost function.

func (*Network) DumpWeightsBiases

func (n *Network) DumpWeightsBiases(fileName string)

DumpWeightsBiases dumps the weights and biases of the network onto a given file.

func (*Network) FeedForward

func (n *Network) FeedForward(input *mat64.Dense) mat64.Dense

FeedForward propagates the input through the network and returns the output.

func (*Network) Init

func (n *Network) Init(size []int)

Init initializes the weights and Biases and set the default cost function of the neural network.

func (*Network) ReadWeightsBiases

func (n *Network) ReadWeightsBiases(fileName string)

ReadWeightsBiases reads weights and biases and sets it onto the network. complimentary to DumpWeightsBiases.

func (*Network) SGD

func (n *Network) SGD(data [][]mat64.Dense, eta float64, batchSize int, test [][]mat64.Dense)

SGD trains the neural network using the given set of inputs and outputs. eta is the desired learning rate of the network.

type TestCompFunc

type TestCompFunc func(output, desiredOutput *mat64.Dense) bool

TestCompFunc is to be defined by the user, here the user gets the output from the Neural Network and the desired output. The user needs to return if the output is acceptable or not.

Jump to

Keyboard shortcuts

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