{"id":21872042,"url":"https://github.com/3outeille/yaae","last_synced_at":"2025-08-20T10:28:26.589Z","repository":{"id":37644315,"uuid":"267268831","full_name":"3outeille/Yaae","owner":"3outeille","description":"Yaae: Yet another autodiff engine (written in Numpy).","archived":false,"fork":false,"pushed_at":"2023-07-06T22:00:36.000Z","size":81718,"stargazers_count":27,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T00:04:05.917Z","etag":null,"topics":["autodifferentiation","autograd","numpy","python"],"latest_commit_sha":null,"homepage":"https://hackmd.io/@machine-learning/blog-post-yaae","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3outeille.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-27T08:51:30.000Z","updated_at":"2025-02-02T21:08:12.000Z","dependencies_parsed_at":"2022-09-15T08:20:39.559Z","dependency_job_id":null,"html_url":"https://github.com/3outeille/Yaae","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3outeille%2FYaae","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3outeille%2FYaae/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3outeille%2FYaae/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3outeille%2FYaae/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3outeille","download_url":"https://codeload.github.com/3outeille/Yaae/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981262,"owners_count":21193147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autodifferentiation","autograd","numpy","python"],"created_at":"2024-11-28T06:18:24.513Z","updated_at":"2025-04-15T00:04:46.470Z","avatar_url":"https://github.com/3outeille.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./img/logo.png\" hspace=\"30%\" width=\"40%\"\u003e\n\n## Introduction\n\n- Yaae (Yet another autodiff engine) is an [automatic differentiation][automatic-diff] engine written in Numpy which comes with a small neural networks library. It supports scalar operations as well as tensors operations and comes with various functions such as exponential, relu, sigmoid ... For educational puprose only.\n\n- Here is my [blog post][blog-post] explaining how an automatic differentiation works and my design/implementation choices.\n\n## Quickstart\n\n- Let's compare a simple example using Yaae and Pytorch.\n\n```python\n# Yaae.\nw1 = Node(2, requires_grad=True)\nw2 = Node(3, requires_grad=True)\nw3 = w2 * w1\nw4 = w1.sin()\nw5 = w3 + w4\nz = w5\nz.backward()\nw1_yaae, w2_yaae, z_yaae = w1, w2, z\n\n# Pytorch.\nw1 = torch.Tensor([2]).double()\nw1.requires_grad = True\nw2 = torch.Tensor([3]).double()\nw2.requires_grad = True\nw3 = w2 * w1\nw4 = w1.sin()\nw5 = w3 + w4\nz = w5\nz.backward()\nw1_torch, w2_torch, z_torch = w1, w2, z\n\n# Forward pass.\nassert z_yaae.data == z_torch.data.item() # True.\n# Backward pass.\nassert w1_yaae.grad.data ==  w1_torch.grad.item() # True.\nassert w2_yaae.grad.data == w2_torch.grad.item() # True.\n```\n\n## Example of usage\n\n- The files [demo_regression.ipynb][demo_regression] and [demo_classification.ipynb][demo_classification] are simple regression/classification problems solved using Yaae. As shown in the notebooks, here are the the results:\n\n\n\u003cimg src=\"./src/example/regression/reg.gif\" hspace=\"25%\" width=\"50%\"\u003e\n\u003cimg src=\"./src/example/classification/class.gif\" hspace=\"25%\" width=\"50%\"\u003e\n\n- If you are still skeptical, here is my [GAN][gan] implemented with Yaae.\n\n\u003cimg src=\"./img/generation_animation.gif\" hspace=\"25%\" width=\"50%\"\u003e\n\n## Installation\n\n- Create a virtual environment in the root folder using [virtualenv][virtualenv] and activate it.\n\n```bash\n# On Linux terminal, using virtualenv.\nvirtualenv my_yaae_env\n# Activate it.\nsource my_yaee_env/bin/activate\n```\n\n- Install **requirements.txt**.\n\n```bash\npip install -r requirements.txt\n# Tidy up the root folder.\npython3 setup.py clean\n```\n\n\u003c!---\nVariables with links.\n--\u003e\n\n[automatic-diff]: https://en.wikipedia.org/wiki/Automatic_differentiation\n[blog-post]: https://hackmd.io/@machine-learning/blog-post-yaae\n[demo_regression]: https://github.com/3outeille/Yaae/blob/master/src/example/demo_regression.ipynb\n[demo_classification]: https://github.com/3outeille/Yaae/blob/master/src/example/demo_classification.ipynb\n[gan]: https://github.com/3outeille/GANumpy\n[virtualenv]: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3outeille%2Fyaae","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3outeille%2Fyaae","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3outeille%2Fyaae/lists"}