{"id":20073126,"url":"https://github.com/pit-ray/vim-autograd","last_synced_at":"2025-10-10T10:33:19.175Z","repository":{"id":41127369,"uuid":"469469566","full_name":"pit-ray/vim-autograd","owner":"pit-ray","description":"Automatic differentiation library written in pure Vim script.","archived":false,"fork":false,"pushed_at":"2024-02-23T14:18:10.000Z","size":275,"stargazers_count":26,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-01T16:30:44.599Z","etag":null,"topics":["autograd","deep-learning","neural-network","vim","vim-autograd","vim8","vim9","vim9script","vimscript"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","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/pit-ray.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"pit-ray"}},"created_at":"2022-03-13T19:13:18.000Z","updated_at":"2024-04-06T12:17:16.000Z","dependencies_parsed_at":"2024-02-23T15:40:50.443Z","dependency_job_id":null,"html_url":"https://github.com/pit-ray/vim-autograd","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/pit-ray%2Fvim-autograd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pit-ray%2Fvim-autograd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pit-ray%2Fvim-autograd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pit-ray%2Fvim-autograd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pit-ray","download_url":"https://codeload.github.com/pit-ray/vim-autograd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224468685,"owners_count":17316420,"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":["autograd","deep-learning","neural-network","vim","vim-autograd","vim8","vim9","vim9script","vimscript"],"created_at":"2024-11-13T14:43:57.831Z","updated_at":"2025-10-10T10:33:14.131Z","avatar_url":"https://github.com/pit-ray.png","language":"Vim Script","readme":"# vim-autograd\n**Automatic differentiation library written in pure Vim script.**\n\n[![test](https://github.com/pit-ray/vim-autograd/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/pit-ray/vim-autograd/actions/workflows/test.yml) [![test-vim9](https://github.com/pit-ray/vim-autograd/actions/workflows/test-vim9.yml/badge.svg?branch=vim9)](https://github.com/pit-ray/vim-autograd/actions/workflows/test-vim9.yml)\n\nvim-autograd provides a foundation for automatic differentiation through the Define-by-Run style algorithm such as Chainer or PyTorch. Since it is written completely in pure Vim script, there are no dependencies.\n\nThis library allows us to create next-generation plugins with numerical computation of multidimensional arrays or deep learning using the gradient descent method.\n\n\n## Installation\n### Vim script\nIf you are using [vim-plug](https://github.com/junegunn/vim-plug), can install as follows.\n\n```vim\nPlug 'pit-ray/vim-autograd'\n```\n\n### Vim9 script\nIf you want to use the more efficient Vim9 script, please install the experimental [vim9 branch](https://github.com/pit-ray/vim-autograd/tree/vim9) implementation.\n\n```vim\nPlug 'pit-ray/vim-autograd', {'branch': 'vim9'}\n```\n\n## Usage\n\nA computational graph is constructed by applying the provided differentiable functions to a Tensor object, and the gradient is calculated by backpropagating from the output.\n\n```vim\nfunction! s:f(x) abort\n  \" y = x^5 - 2x^3\n  let y = autograd#sub(a:x.p(5), a:x.p(3).m(2))\n  return y\nendfunction\n\nfunction! s:example() abort\n  let x = autograd#tensor(2.0)\n  let y = s:f(x)\n\n  call y.backward()\n  echo x.grad.data\nendfunction\n\ncall s:example()\n```\n\n**Output**\n```\n[56.0]\n```\n\nThe computational graph is automatically generated like the below.\n\n\u003cimg src=\"examples/images/example1.png\" height=500 /\u003e\n\n## Examples\n- [Basic differentiation and computational graph visualization](examples/README.md#simplest-differentiation)\n- [Higher-order differentiation using double-backprop](examples/README.md#higher-order-differentiation)\n- [Classification using deep learning](examples/README.md#classification-using-deep-learning)\n\n## Related posts\n- https://zenn.dev/pitray/articles/482e89ddff329c\n\n## References\n- [oreilly-japan/deep-learning-from-scratch-3](https://github.com/oreilly-japan/deep-learning-from-scratch-3)\n- [chainer/chainer](https://github.com/chainer/chainer)\n- [pytorch/pytorch](https://github.com/pytorch/pytorch)\n- [numpy/numpy](https://github.com/numpy/numpy)\n- [mattn/vim-brain](https://github.com/mattn/vim-brain)\n\n## License\nThis library is provided by **MIT License**.\n\n## Author\n- pit-ray\n","funding_links":["https://github.com/sponsors/pit-ray"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpit-ray%2Fvim-autograd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpit-ray%2Fvim-autograd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpit-ray%2Fvim-autograd/lists"}