This is a generalized neural network package with clean and transparent API for the Go language. Also available for javascript github/lovesaroha/lnn.js
- Lightweight and Fast.
- Native Go implementation.
- Tensor Operations.
- Sequential Models.
- Support loss functions like (Mean Square Error).
- Opitmization algorithms like (Gradient Descent).
- Go 1.9 or higher. We aim to support the 3 latest versions of Go.
Simple install the package to your $GOPATH with the go tool from shell:
go get -u github.com/lovesaroha/lnn
Make sure Git is installed on your machine and in your system's PATH
.
// Create tensor of given shape.
tensor := lnn.Tensor([]int{3, 4})
// Print values.
tensor.Print()
// Create tensor of given shape and (minimum, maximum).
tensor := lnn.Tensor([]int{3, 4} , -1 , 1)
// Print values.
tensor.Print()
// Scalar tensor.
stensor := lnn.Tensor([]int{} , -1 , 1)
// Print values.
stensor.Print()
// Slice of int to tensor and print values.
lnn.ToTensor([]int{1, 2, 3}).Print()