Chapter 0: Fundamentals - ARENA
Note - this section contains a large number of exercises. You should feel free to skim through them if you feel comfortable with the basic ideas. arr is a 4D numpy array. The first axes corresponds to the number, and the next three axes are channels (i.e. RGB), height and width respectively. You have the function utils.display_array_as_img which takes in a numpy array and displays it as an image. There are two possible ways this function can be run: For example: A series of images follow below, which have been created using einops functions performed on arr. You should work through these and try to produce each of the images yourself. This page also includes solutions, but you should only look at them after you've tried for at least five minutes. Note - if you find you're comfortable with the first ~half of these, you can skip to later sections if you'd prefer, since these aren't particularly conceptually important. In this example we take just the first digit, and copy it along rows u
2️⃣ Einops, Einsum & Tensor Manipulation Learning Objectives Understand the basics of Einstein summation convention Learn how to use einops to perform basic tensor rearrangement, and einsum to to perform standard linear algebra operations on tensors Note - this section contains a large number of exercises. You should feel free to skim through them if you feel comfortable with the basic ideas. Reading Read about the benefits of the einops library here . If you haven't already, then review the Einops basics tutorial (up to the "fancy examples" section). Read einsum is all you need (or watch it )
Explore this link on the map →related reading
- Einsum is easy and usefulejenner.com
- Einops tutorial, part 1: basics - Einopseinops.rocks
- Chapter 0: Fundamentals - ARENAlearn.arena.education
- Tim Rocktäschelrockt.github.io
- Tim Rocktäschelrockt.ai
- Tensors — PyTorch Tutorials 2.12.0+cu130 documentationpytorch.org
- PyTorch internals : ezyang's blogblog.ezyang.com
- Computing sharding with einsum : ezyang's blogblog.ezyang.com
- Einops: Powerful library for tensor operations in deep learning | Oxford Protein Informatics Groupblopig.com
- Tensors — PyTorch Tutorials 2.13.0+cu130 documentationdocs.pytorch.org
- Tiny TPUtinytpu.com
- torch.Tensor — PyTorch 2.12 documentationdocs.pytorch.org