A walkthrough of a small engine for automatic differentiation
Project description
fauxgrad
There's plenty of excellent (tinygrad) and minimalist (micrograd) built-from-scratch, deep learning frameworks out there, so the goal of fauxgrad
is to sacrifice some of the full functionality, and focus on the general idea and building blocks for writing your own.
The walkthrough/tutorial can be found in this notebook.
Installation
pip install fauxgrad
Examples
Calculating some gradients:
a = Value(5)
b = Value(-3)
c = a * b
d = a + c
e = d * 2
e.backward()
print(f'The derivative that we computed before, de/da:', a.grad)
>>> -4.0
Plotting the backward pass graph:
from fauxgrad.utils import plot_graph
plot_graph(e)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fauxgrad-0.2.tar.gz
(6.5 kB
view details)
Built Distribution
File details
Details for the file fauxgrad-0.2.tar.gz
.
File metadata
- Download URL: fauxgrad-0.2.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f07befd97277789df54ee5a370f6a3c4d7e4d3f0028413433ff60b800a4efa69 |
|
MD5 | e20e1a1c1e5f651cee8df4fdd7a55e40 |
|
BLAKE2b-256 | fad50597af29d8f8790651a54d2da793cc3fa8deb905059ecd79ac1bb30caea1 |
File details
Details for the file fauxgrad-0.2-py3-none-any.whl
.
File metadata
- Download URL: fauxgrad-0.2-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2cdc8cd5d7fd0973ff0e7a17541b458a1c683091112860f13744eb5fbf7425e |
|
MD5 | 482f2053764e5dec181e32bbfebf9640 |
|
BLAKE2b-256 | 1aa9714cd9435f7602de736e5007730e20b6802ecd72968558aa97b4e0cfe63a |