An Automatic Differentiation Library for Python 3. This project was done for CS207 at Harvard University, taught by Professor David Sondak. Check out our Documentation for more details!
Download our project on PyPI using the following command:
pip install VayDiff
Clone or download our GitHub repository and navigate into this directory in your terminal.
Optional: create a virtual environment using virtualenv
. This can be downloaded using pip3
or easy_install
as follows:
pip3 install virtualenv
or
sudo easy_install virtualenv
Then, create a virtual environment (using Python3), activate this virtual environment, and install the dependencies as follows:
virtualenv -p python3 my_env
source my_env/bin/activate
pip3 install -r requirements.txt
In order to deactivate the virtual environment, use the following command
deactivate
from VayDiff.VayDiff import Variable
from VayDiff.VayDiff import Diff
def user_function(a):
return a**2
x = Variable(3, name='x')
t = Diff().auto_diff(user_function, [x])
print(t.val, t.der['x'])
9 6.0
Look at our Feature section for examples and more fractals.
- Abhimanyu Vasishth
- Zheyu Wu
- Yiming Xu