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

https://github.com/0verread/minigrad

Andrej Karpathy's Micrograd in Go
https://github.com/0verread/minigrad

autograd golang neural-network

Last synced: about 2 months ago
JSON representation

Andrej Karpathy's Micrograd in Go

Awesome Lists containing this project

README

          

# minigrad
A neural network library in golang on an autograd engine. Faster and easy to use like PyTorch. ( This is Andrej Karpathy's [Micrograd](https://github.com/karpathy/micrograd) implementation in Go)

## Usage
```go
package main

import (
mg "github.com/0verread/minigrad"
)

func main() {
a := mg.NewValue(-4.0, nil, "")
b := mg.NewValue(2.0, nil, "")
c := a.Add(b)
d := a.Mul(b).Add(b.Pow(3))
c = c.Add(c.Add(mg.NewValue(1.0, nil, "")))
c = c.Add(mg.NewValue(1.0, nil, "").Add(c))
d = d.Add(d.Mul(2.0).Add(b.Add(a).Relu()))

d.Backward()

}
```

## Contribution

Feel free to raise a issue or PR to make enhancements or report a bug. I would
love to see more test cases.

## License

minigrad is under [MIT](https://github.com/0verread/LICENSE).