Small neural network library in pure Python and numpy.
Go to file
2020-11-16 11:43:51 +00:00
assets Add logo to README 2020-11-14 23:07:42 +00:00
pygrad Remove tensor prefix 2020-11-16 11:43:51 +00:00
.gitignore Add rule to ignore __pycache__ 2020-11-15 19:05:06 +00:00
README.md Update README to reflect added support for arrays 2020-11-15 19:04:49 +00:00


Neural network library written in Python completely from scratch, using only numpy.

Usage

from pygrad.tensor import Tensor

a, b = Tensor(np.random.randn(3, 1)), Tensor(np.random.randn(1, 3))
c = a.mul(b)
d = c.exp()
d.backward()

print(a.grad, b.grad, c.grad)
# should output something like
#  [[-16.51232262 -16.51232262 -16.51232262]]
#  [[-53.88103349 -53.88103349 -53.88103349]]
#  [[ 3.50417648  3.50417648  3.50417648]
#   [15.67424587 15.67424587 15.67424587]
#   [16.0131011  16.0131011  16.0131011 ]]

References

Copying

This is free and unencumbered software released into the public domain.