This is the code repository accompanying the two-parts blog posts series:
- A Hands-on Introduction to Automatic Differentiation - Part 1.
- Build Your own Deep Learning Framework - A Hands-on Introduction to Automatic Differentiation - Part 2
Before using the code, there are some requirements that needs to be present on your machine to run the code samples in the Jupyter notebooks. Some of these requirements are internal and can be easily fetched with Python's pip
across the different platforms. Other requirements are external and needs to be fetched from other sources than Python's pip
, and these sources usually differ based on your operating system. But fear not, it's quite simple to get them and you'll find the how-to instruction below.
For the code to work, we need to have both graphviz
and ffmpeg
to be installed on your machine. These packages are mainly concerned with the computational graph visualizations and the animated reverse automatic differentiation visualizations. We here provide the instructions on how to install them on Ubuntu, macOs, and Windows.
- Simply run
sudo apt install graphviz
- Install Homebrew package manager.
- Run
brew install graphviz
- Download the .msi installer from graphviz website
- Run the installer.
- Locate the install location (which will probably be
C:\Program Files (x86)\GraphViz2.38
) - Add
C:\Program Files (x86)\GraphViz2.38\bin
to yourPATH
environment variable.
- Simply run
sudo apt install ffmpeg
- Install Homebrew package manager.
- Run
brew install ffmpeg
- Download the windows static build from ffmpeg website, which is a zip file.
- Unzip the build file in your preferred location (Let it be
C:\Program Files (x86)\ffmpeg
) - Add
C:\Program Files (x86)\ffmpeg\bin
to yourPATH
environment variable.
this assumes that you have python3.5 installed on your machine and you know how to use Jupyter notebooks
- Make sure that you have the
virtualenv
package by runningpip3 install virtualenv
- Open the terminal at your local copy of this repository and create a fresh virtual environment with
python3 -m venv venv
- Activate your new virtual environment with
source venv/bin/activate
- Run
pip install -r requirements.txt
- Install an IPython notebook kernel pointing to your virtual environment to use with the notebooks via
python -m ipykernel install --user --name AD
- Fire up jupyter notebook with
jupyter notebook
and start using the code.