← Open Source
goml

gobrain

Neural Networks written in go.

Model DevelopmentDeep Learning FrameworksGo
Open on GitHub
Momentum
+0stars in 24 hours0.0%
569
Stars
61
Forks
+0
This week
6
Contributors
Created 2014-04-29 · Updated 2026-08-19 · #16852 today
Top developers
jonhkraxamonbryant1410

goml/gobrain is ranked 16,852 with 569 stars.

Same-category comparison

goml/gobrain is ranked 16,852 among these 8 peers; mlverse/torch is ranked 16,857.

Same-category comparison
NameRankMetrics
tobybreckon/fire-detection-cnn16,835
Language:
Python
Stars:
570
Forks:
173
Description:
real-time fire detection in video imagery using a convolutional neural network (deep learning) - from our ICIP 2018 paper (Dunnings / Breckon) + ICMLA 2019 paper (Samarth / Bhowmik / Breckon).
vsyw/Keras-OpenFace16,838
Language:
Jupyter Notebook
Stars:
570
Forks:
252
Description:
Keras-OpenFace is a project converting OpenFace from Torch implementation to a Keras version.
1x-technologies/1xgpt16,841
Language:
Python
Stars:
569
Forks:
50
Description:
world modeling challenge for humanoid robots.
AssafSinger94/dino-tracker16,842
Language:
Python
Stars:
569
Forks:
52
Description:
Official Pytorch Implementation for “DINO-Tracker: Taming DINO for Self-Supervised Point Tracking in a Single Video” (ECCV 2024).
mlverse/torch16,857
Language:
C++
Stars:
569
Forks:
93
Description:
R Interface to Torch.
mmasana/FACIL16,858
Language:
Python
Stars:
569
Forks:
102
Description:
Framework for Analysis of Class-Incremental Learning with 12 state-of-the-art methods and 3 baselines.
ilovepose/DarkPose16,865
Language:
Cuda
Stars:
568
Forks:
82
Description:
Distribution-Aware Coordinate Representation for Human Pose Estimation.
microsoft/foldingdiff16,871
Language:
Jupyter Notebook
Stars:
568
Forks:
75
Description:
Diffusion models of protein structure; trigonometry and attention are all you need.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguageGo
CategoryModel Development
SubcategoryDeep Learning Frameworks
KeywordsGo
Stars569
Forks61
Contributors6
Created date2014-04-29
Updated date2026-08-19
Stars in 1 day0
Stars in 7 days0
Rank16,852
Previous rank16,643
Rank change-209
7-day stars rank15,764
Previous 7-day stars rank15,771
7-day stars rank change7
Total stars rank17,517
Previous total stars rank17,481
Total stars rank change-36
README summary

gobrain Neural Networks written in go Getting Started The version includes just basic Neural Network functions such as Feed Forward and Elman Recurrent Neural Network. A simple Feed Forward Neural Network can be constructed and trained as follows: After running this code the network will be trained and ready to be used. The network can be tested running using the method, for instance: The test operation will print in the console something like: Where the first values are the inputs

, the values after the arrow are the output values from the network and the values after are the expected outputs. The method can be used to predict the output given an input, for example: the output will be a vector with values ranging from to . In the example folder there are runnable examples with persistence of the trained network on file. In example/02 the network is saved on file and in example/03 the network is loaded from file

. To run the example cd in the folder and run Recurrent Neural Network This library implements Elman's Simple Recurrent Network. To take advantage of this, one can use the function. In the example above, a single context will be created initialized with . It is also possible to create custom initialized contexts, for instance: Note that custom contexts must have the same size of hidden nodes + 1 (bias node), in the example above the size of hidden nodes is 2, thus

the context has 3 values. 0 - Added Feed Forward Neural Network with contexts from Elman RNN

Frequently asked questions

How many stars and forks are recorded?

goml/gobrain has 569 stars and 61 forks.

What is the repository rank?

goml/gobrain is ranked 16,852.

What language and category are recorded?

goml/gobrain has 569 stars, uses Go and belongs to Model Development.

Which repository is closest in rank?

goml/gobrain is compared with mlverse/torch, ranked 16,857 with 569 stars.

README

gobrain

Neural Networks written in go

Getting Started

The version 1.0.0 includes just basic Neural Network functions such as Feed Forward and Elman Recurrent Neural Network. A simple Feed Forward Neural Network can be constructed and trained as follows:

package main

import (
	"github.com/goml/gobrain"
	"math/rand"
)

func main() {
	// set the random seed to 0
	rand.Seed(0)

	// create the XOR representation patter to train the network
	patterns := [][][]float64{
		{{0, 0}, {0}},
		{{0, 1}, {1}},
		{{1, 0}, {1}},
		{{1, 1}, {0}},
	}

	// instantiate the Feed Forward
	ff := &gobrain.FeedForward{}

	// initialize the Neural Network;
	// the networks structure will contain:
	// 2 inputs, 2 hidden nodes and 1 output.
	ff.Init(2, 2, 1)

	// train the network using the XOR patterns
	// the training will run for 1000 epochs
	// the learning rate is set to 0.6 and the momentum factor to 0.4
	// use true in the last parameter to receive reports about the learning error
	ff.Train(patterns, 1000, 0.6, 0.4, true)
}

After running this code the network will be trained and ready to be used.

The network can be tested running using the Test method, for instance:

ff.Test(patterns)

The test operation will print in the console something like:

[0 0] -> [0.057503945708445]  :  [0]
[0 1] -> [0.930100635071210]  :  [1]
[1 0] -> [0.927809966227284]  :  [1]
[1 1] -> [0.097408795324620]  :  [0]

Where the first values are the inputs, the values after the arrow -> are the output values from the network and the values after : are the expected outputs.

The method Update can be used to predict the output given an input, for example:

inputs := []float64{1, 1}
ff.Update(inputs)

the output will be a vector with values ranging from 0 to 1.

In the example folder there are runnable examples with persistence of the trained network on file.

In example/02 the network is saved on file and in example/03 the network is loaded from file.

To run the example cd in the folder and run

go run main.go

Recurrent Neural Network

This library implements Elman's Simple Recurrent Network.

To take advantage of this, one can use the SetContexts function.

ff.SetContexts(1, nil)

In the example above, a single context will be created initialized with 0.5. It is also possible to create custom initialized contexts, for instance:

contexts := [][]float64{
	{0.5, 0.8, 0.1}
}

Note that custom contexts must have the same size of hidden nodes + 1 (bias node), in the example above the size of hidden nodes is 2, thus the context has 3 values.

Changelog

  • 1.0.0 - Added Feed Forward Neural Network with contexts from Elman RNN
Nearby in the ranking
Similar items