Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simplegrad

micrograd with tensors. Matmul, reshapes, broadcasting, sum etc. This is a toy project.

from simplegrad.engine import Value

# simplegrad supports tensors
a = Value([[[1,2], [3,4]], [[2,1], [4,3]]])
b = [-1, 1]

# matmul and broadcast semantics work
c = a @ b + b
d = 2 * c.relu()

# reshapes too
e = d.reshape((4,))

# call Value.backward() to backprop
e.grad = [1,2,3,4]
e.backward()

demo

demo.ipynb showcases how to build a model with simplegrad for the moon dataset. It's adapted from the micrograd demo.

decision boundary

About

Small backprop library for tensors with a neural-net API included

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages