Create simple feed forward networks in Go
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})
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)
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