Skip to content

0verread/minigrad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minigrad

A neural network library in golang on an autograd engine. Faster and easy to use like PyTorch. ( This is Andrej Karpathy's Micrograd implementation in Go)

Usage

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.

About

Andrej Karpathy's Micrograd in Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages