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
- Host: GitHub
- URL: https://github.com/jsmith/gnn
- Owner: jsmith
- License: mit
- Created: 2017-12-13T02:00:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-25T20:55:12.000Z (over 7 years ago)
- Last Synced: 2026-05-12T18:38:49.982Z (about 1 month ago)
- Language: Go
- Size: 58.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](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*