olivia: github.com/olivia-ai/olivia/neuralnet Index | Files

package neuralnet

import "github.com/olivia-ai/olivia/neuralnet"

Index

Package Files

math.go matrix.go neuralnet.go

func ApplyFunc Uses

func ApplyFunc(x []float64, fn func(x float64) float64) []float64

ApplyFunc returns an array of the same size than x where all values have been modified by fn

func ApplyWeights Uses

func ApplyWeights(length int, layer []float64, weights [][]float64) (output []float64)

ApplyWeights returns the next layer where the weights have been applied to the values of the previous layer.

func MakeMatrix Uses

func MakeMatrix(rows, columns int, value float64) [][]float64

Returns the value of a matrix of *rows* and *columns* dimensions where all the values are equals to *value*.

func RandomIndexes Uses

func RandomIndexes(length int) []int

func RandomMatrix Uses

func RandomMatrix(rows, columns int, lower, upper float64) [][]float64

Returns the value of a random matrix of *rows* and *columns* dimensions and where the values are between *lower* and *upper*.

func Sigmoid Uses

func Sigmoid(x float64) float64

func SigmoidDerivative Uses

func SigmoidDerivative(x float64) float64

type NeuralNetwork Uses

type NeuralNetwork struct {
    HiddenLayer      []float64
    InputLayer       []float64
    OutputLayer      []float64
    WeightHidden     [][]float64
    WeightOutput     [][]float64
    ErrOutput        []float64
    ErrHidden        []float64
    LastChangeHidden [][]float64
    LastChangeOutput [][]float64
    Rate1            float64
    Rate2            float64
}

func CreateNetwork Uses

func CreateNetwork(input, hidden, output int, rate1, rate2 float64) *NeuralNetwork

CreateNetwork returns a new network where layers are built with number of input, hidden and output layers and the learning rates.

func LoadNeuralNetwork Uses

func LoadNeuralNetwork(fileName string) *NeuralNetwork

func (*NeuralNetwork) CalculateError Uses

func (neuralNetwork *NeuralNetwork) CalculateError(target []float64) float64

func (*NeuralNetwork) FeedBack Uses

func (neuralNetwork *NeuralNetwork) FeedBack(target []float64)

FeedBack makes back propagation for a single target

func (*NeuralNetwork) FeedForward Uses

func (neuralNetwork *NeuralNetwork) FeedForward(input []float64) (output []float64)

FeedForward makes forward propagation for a single input

func (NeuralNetwork) Save Uses

func (neuralNetwork NeuralNetwork) Save(fileName string)

func (*NeuralNetwork) Train Uses

func (neuralNetwork *NeuralNetwork) Train(inputs [][]float64, targets [][]float64, iterations int)

Package neuralnet imports 8 packages (graph) and is imported by 2 packages. Updated 2019-08-09. Refresh now. Tools for package owners.