Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aunum/goro
A High-level Machine Learning Library for Go
https://github.com/aunum/goro
data-science go golang machine-learning machinelearning
Last synced: about 2 months ago
JSON representation
A High-level Machine Learning Library for Go
- Host: GitHub
- URL: https://github.com/aunum/goro
- Owner: aunum
- License: apache-2.0
- Created: 2020-03-29T21:00:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-04T22:32:48.000Z (9 months ago)
- Last Synced: 2024-08-01T04:02:12.742Z (4 months ago)
- Topics: data-science, go, golang, machine-learning, machinelearning
- Language: Go
- Homepage:
- Size: 18.1 MB
- Stars: 370
- Watchers: 18
- Forks: 20
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-ai - goro - level Machine Learning Library for Go. (General Machine Learning libraries)
README
![logo](./static/logo.png)
[![GoDoc](https://godoc.org/github.com/aunum/goro?status.svg)](https://godoc.org/github.com/aunum/goro)
[![Go Report Card](https://goreportcard.com/badge/github.com/aunum/goro)](https://goreportcard.com/report/github.com/aunum/goro)
# Overview
Goro is a high-level machine learning library for Go built on [Gorgonia](https://gorgonia.org). It aims to have the same feel as [Keras](https://keras.io/).## Usage
```go
import (
. "github.com/aunum/goro/pkg/v1/model"
"github.com/aunum/goro/pkg/v1/layer"
)// 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)
```## Examples
See the [examples](./examples) folder for example implementations.There are many examples in the reinforcement learning library [Gold](https://github.com/aunum/gold).
## Docs
Each package contains a README explaining the usage, also see [GoDoc](https://godoc.org/github.com/aunum/goro).## Contributing
Please open an MR for any issues or feature requests.Feel free to ping @pbarker on Gopher slack.
## Roadmap
- [ ] RNN
- [ ] LSTM
- [ ] Summary
- [ ] Visualization