An open API service indexing awesome lists of open source software.

https://github.com/jsmith/gnn

Golang neural network framework
https://github.com/jsmith/gnn

Last synced: 28 days ago
JSON representation

Golang neural network framework

Awesome Lists containing this project

README

          

[![Build Status](https://travis-ci.org/jsmith/gnn.png?branch=master)](https://travis-ci.org/jsmith/gnn)
# GNN
Golang Neural Network (GNN) framework! GNN was built for educational purposes to learn about neural networks & goland! Currently this framework is able to implement simple fully connected networks.

# Example
```go
net := Net{
NewFC(2, 4),
&ReLU{},
InitFC(4, 1),
&Sigmoid{},
}

trainer = Trainer{
Net: net,
Cost: SE{}, // Standard Error Loss
LearningRate: 0.1,
Epochs: 10000,
BatchSize: 4,
}

xor = data.Init(
mat.InitRows(
vec.Init(0, 0, 1, 1),
vec.Init(0, 1, 1, 0),
),
mat.InitRows(
vec.Init(0, 1, 1, 0),
),
)

trainer.Train(xor)
predictions := trainer.Predict(xor.Data())
```

See `trainer_test.go:TestTrainer` for a worker example.

*[anynet](https://github.com/unixpickle/anynet) used as reference*