lucaionescu / gograd

Gograd is a small automatic differentiation framework written in Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gograd

Test

Gograd is a small automatic reverse-mode differentiation framework written in Go.

Example

a := NewVar(4)
b := NewVar(3)
c := a.Mul(a.Add(b))

c.Backward()

fmt.Println(c.value)
// prints 28

fmt.Println(a.grad)
// prints 11

fmt.Println(b.grad)
// prints 4

Resources

About

Gograd is a small automatic differentiation framework written in Go.

License:MIT License


Languages

Language:Go 100.0%