Skip to content

liutongyu0304/smartnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smartnet

a smart(simple) implementation of dynamic compute graph and neural net just like pytorch based on numpy and cupy.

how to use

it is much alike pytorch. for a simple optimization problem:

min f(x) = (x1 - 1)^2 + (x2 - 1)^2
x0 = [0.0, 0.0]

obviously x_opt = [1.0, 1.0]. we can solve it with smartnet

import smartnet as sn


x = sn.zeros((2, 1), requires_grad=True)
for i in range(1000):
    x.zero_grad()
    y = sn.sum((x - 1)**2)
    y.backward()
    x.update_data(0.01)
print(x)

for more usage see examples and tests.

About

a smart(simple) implementation of dynamic compute graph and neural net just like pytorch based on numpy and cupy.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages