Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/aunum/goro

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/aunum/goro

  • v0.0.0-20210130030158-f83957ed3c81
  • Source
  • Go
  • Socket score

Version published
Created
Source

logo
GoDoc Go Report Card

Overview

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

Usage

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 folder for example implementations.

There are many examples in the reinforcement learning library Gold.

Docs

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

Contributing

Please open an MR for any issues or feature requests.

Feel free to ping @pbarker on Gopher slack.

Roadmap

  • RNN
  • LSTM
  • Summary
  • Visualization

FAQs

Package last updated on 30 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc