Naive Automatic Differentiation Library (nadl) a small framework that can perform automatic differentiation. This framework is very simple implementation of how other big framworks do gradient calculation using Numerical Automatic Differentiation.
$ git clone https://github.com/siAyush/nadl.git
$ cd nadl
$ python3 setup.py install
The quickest way to start using nadl:
- Clone this repository and install.
- Make a python file and import
nadl
. - Write your code.
Example:
from nadl.tensor import Tensor
t1 = Tensor([1, 2, 3], requires_grad=True)
t2 = Tensor([4, 5, 6], requires_grad=True)
t3 = t1 + t2
I have added a few basic unit tests. The command should be executed in the repository's root directory to run the test:
$ git clone https://github.com/siAyush/nadl.git
$ cd nadl
$ pytest