Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Automatic differentiation library written in pure Vim script.

License

NotificationsYou must be signed in to change notification settings

pit-ray/vim-autograd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automatic differentiation library written in pure Vim script.

testtest-vim9

vim-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.

This library allows us to create next-generation plugins with numerical computation of multidimensional arrays or deep learning using the gradient descent method.

Installation

Vim script

If you are usingvim-plug, can install as follows.

Plug'pit-ray/vim-autograd'

Vim9 script

If you want to use the more efficient Vim9 script, please install the experimentalvim9 branch implementation.

Plug'pit-ray/vim-autograd', {'branch':'vim9'}

Usage

A computational graph is constructed by applying the provided differentiable functions to a Tensor object, and the gradient is calculated by backpropagating from the output.

function!s:f(x)abort" y = x^5 - 2x^3lety=autograd#sub(a:x.p(5),a:x.p(3).m(2))returnyendfunctionfunction!s:example()abortletx=autograd#tensor(2.0)lety=s:f(x)cally.backward()echox.grad.dataendfunctioncalls:example()

Output

[56.0]

The computational graph is automatically generated like the below.

Examples

Related posts

References

License

This library is provided byMIT License.

Author

  • pit-ray

About

Automatic differentiation library written in pure Vim script.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

[8]ページ先頭

©2009-2025 Movatter.jp