by aunum

aunum / goro

A High-level Machine Learning Library for Go

254 Stars 9 Forks Last release: Not found Apache License 2.0 8 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

GoDoc Go Report Card


Goro is a high-level machine learning library for Go built on Gorgonia. It aims to have the same feel as Keras.


import (
    . "github.com/aunum/goro/pkg/v1/model"

// create the 'x' input e.g. mnist image x := NewInput("x", []int{1, 28, 28})

// create the 'y' or expect output e.g. labels y := NewInput("y", []int{10})

// create a new sequential model with the name 'mnist' model, _ := NewSequential("mnist")

// add layers to the model model.AddLayers( layer.Conv2D{Input: 1, Output: 32, Width: 3, Height: 3}, layer.MaxPooling2D{}, layer.Conv2D{Input: 32, Output: 64, Width: 3, Height: 3}, layer.MaxPooling2D{}, layer.Conv2D{Input: 64, Output: 128, Width: 3, Height: 3}, layer.MaxPooling2D{}, layer.Flatten{}, layer.FC{Input: 128 * 3 * 3, Output: 100}, layer.FC{Input: 100, Output: 10, Activation: layer.Softmax}, )

// pick an optimizer optimizer := g.NewRMSPropSolver()

// compile the model with options model.Compile(xi, yi, WithOptimizer(optimizer), WithLoss(m.CrossEntropy), WithBatchSize(100), )

// fit the model model.Fit(xTrain, yTrain)

// use the model to predict an 'x' prediction, _ := model.Predict(xTest)

// fit the model with a batch model.FitBatch(xTrainBatch, yTrainBatch)

// use the model to predict a batch of 'x' prediction, _ = model.PredictBatch(xTestBatch)


See the examples folder for example implementations.

There are many examples in the reinforcement learning library Gold.


Each package contains a README explaining the usage, also see GoDoc.


Please open an MR for any issues or feature requests.

Feel free to ping @pbarker on Gopher slack.


  • [ ] RNN
  • [ ] LSTM
  • [ ] Summary
  • [ ] Visualization

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.