Skip to content

wbrc/neuralnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

neuralnet

Create simple feed forward networks in Go

GoDoc Build Status codecov rcard

Getting Started

Create a network with three input neurons, two hidden layers with four and two neurons and an output layer with one neuron:

n := neuralnet.NewNeuralNetwork([]uint{3, 4, 2, 1})

Basic usage

Train the network:

input := []float64{1.0, 1.0}
output := []float64{0.0}
n.Train(input, output, 0.25)

Predict the output:

prediction := n.Predict(data)

Persisting the network

Persist the network:

file, _ := os.Create("network.json")
n.Dump(file)

Load persisted network:

file, _ := os.Open("network.json")
n, _ = neuralnet.LoadNeuralNetwork(ifile)

For more detailed info see examples folder