Tim Rocktäschel
When talking to colleagues I realized that not everyone knows about einsum, my favorite function for developing deep learning models. This post is trying to change that once and for all! :) Einstein summation (einsum) is implemented in numpy, as well as deep learning libraries such as TensorFlow and, thanks to Thomas Viehmann, recently also PyTorch. For background reading on einsum, I recommend the excellent blog posts by Olexa Bilaniuk and Alex Riley. While their posts discuss einsum in the context of numpy, I am going to illustrate how einsum is extremely useful for writing elegant PyTorch/TensorFlow models.1 If you are anything like me, you find it difficult to remember the names and signatures of all the different functions in PyTorch/TensorFlow for calculating dot products, outer products, transposes and matrix-vector or matrix-matrix multiplications. Einsum notation is an elegant way to express all of these, as well as complex operations on tensors, using essentially a domain-spe
Tim Rocktäschel Tim Rocktäschel Artificial General Intelligence, Open-endedness, Self-Improvement, Reinforcement Learning Spatial Lorem ipsum dolor sit amet nullam consequat interdum vivamus donce sed libero. Get Started --> – Tim Rocktäschel, 30/04/2018 – updated 02/05/2018 When talking to colleagues I realized that not everyone knows about einsum , my favorite function for developing deep learning models. This post is trying to change that once and for all! :) Einstein summation (einsum) is implemented in numpy , as well as deep learning libraries such as TensorFlow and, thanks
Explore this link on the map →related reading
- Tim Rocktäschelrockt.github.io
- Einsum is easy and usefulejenner.com
- Computing sharding with einsum : ezyang's blogblog.ezyang.com
- Einops: Powerful library for tensor operations in deep learning | Oxford Protein Informatics Groupblopig.com
- Chapter 0: Fundamentals - ARENAlearn.arena.education
- Transformers from Scratche2eml.school
- Tiny TPUtinytpu.com
- 2404.17625arxiv.org
- The Little Book of Deep Learningfleuret.org
- PyTorch internals : ezyang's blogblog.ezyang.com
- Einops tutorial, part 1: basics - Einopseinops.rocks
- Tensors — PyTorch Tutorials 2.12.0+cu130 documentationpytorch.org