All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

mytorch: Python Automatic Differentiation Library Inspired by PyTorch

By

iguana2000

4mo ago· 3 min readenCode

Summary

mytorch is an open-source Python library that implements automatic differentiation with a PyTorch-like API, using NumPy for computations. The project demonstrates graph-based reverse-mode autodifferentiation that can compute arbitrarily high derivatives for both scalars and non-scalars. The implementation is designed to be easily extensible, with potential for adding neural network modules (torch.nn) and GPU support via CuPy or Numba. The author notes it would be an interesting but 'useless' endeavor to rewrite it in a low-level language using BLAS library calls like PyTorch does.

Key quotes

· 5 pulled
Easily extensible autograd implemented python with pytorch API.
Uses numpy to do the heavy-lifting.
Implementation is very similar to pytorch (graph-based reverse-mode autodiff).
It would be an interesting (but useless) endeavor to rewrite mytorch in a low level language using BLAS library calls instead on numpy, just like pytorch.
mytorch supports the computation of arbitrarily high derivatives for both scalars and non-scalars.
Snippet from the RSS feed
Automatic differentiation implemented in python, inspired by Pytorch (easily extensible) - obround/mytorch

You might also wanna read