{"id":16388489,"url":"https://github.com/arthurdouillard/nalu.pytorch","last_synced_at":"2025-10-08T10:23:09.351Z","repository":{"id":98393257,"uuid":"151837069","full_name":"arthurdouillard/nalu.pytorch","owner":"arthurdouillard","description":"Implementation of NALU \u0026 NAC (https://arxiv.org/abs/1808.00508 | DeepMind) in PyTorch.","archived":false,"fork":false,"pushed_at":"2018-10-06T19:14:37.000Z","size":513,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T17:44:43.144Z","etag":null,"topics":["deep-learning","neural-arithmetic-logic-unit","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arthurdouillard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-06T12:17:45.000Z","updated_at":"2020-11-24T19:22:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"9b380345-9149-4a10-af86-cf4d4dc5ff3f","html_url":"https://github.com/arthurdouillard/nalu.pytorch","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/arthurdouillard%2Fnalu.pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurdouillard%2Fnalu.pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurdouillard%2Fnalu.pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurdouillard%2Fnalu.pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arthurdouillard","download_url":"https://codeload.github.com/arthurdouillard/nalu.pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245056889,"owners_count":20553855,"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":["deep-learning","neural-arithmetic-logic-unit","pytorch"],"created_at":"2024-10-11T04:29:14.386Z","updated_at":"2025-10-08T10:23:04.316Z","avatar_url":"https://github.com/arthurdouillard.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Summary\n\nThis is a PyTorch implementation of [Neural Arithmetic Logic Units](https://arxiv.org/abs/1808.00508)\nfrom DeepMind.\n\nThe goal of this paper is to *count* using neural networks. Two networks are\npresented, **NAC** and **NALU**. The first is used for addition \u0026 substraction\nwhile the second is used for multiplication, division, square, and square root.\n\nThe paper was implemented in the python module `nalu.py`.\n\n![nalu](images/nac_nalu.png)\n\n# Tests\n\nSeveral tests are shown in the paper, I've only implemented what they called\nthe *Static (non-recurrent) arithmetic tests* (appendix B) where the network\nmust learn several kinds of operations.\n\nIt is first train on a range of number, then it is tested on a range of number\nthe network never saw: **interpolation** \u0026 **extrapolation**.\n\nI've used the range [1, 100] for the first task and [101, 200] for the second.\n\nThe following image shows the results. See the jupyter notebook `train.ipynb` if\nyou want to know the full train procedure.\n\n![results](images/results.png)\n\n# References\n\n```\n@misc{1808.00508,\nAuthor = {Andrew Trask and Felix Hill and Scott Reed and Jack Rae and Chris Dyer and Phil Blunsom},\nTitle = {Neural Arithmetic Logic Units},\nYear = {2018},\nEprint = {arXiv:1808.00508},\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurdouillard%2Fnalu.pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthurdouillard%2Fnalu.pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurdouillard%2Fnalu.pytorch/lists"}