Project DelphiTensors Workshop
Knowledge
06 · Contraction with einsum

06 · Contraction with einsum

Part IV, Block 3 of Tensors for Machine Learning. One rule that looks compact in code and has a very simple meaning:

If an index disappears after ->, NumPy sums over it. If the index remains, it survives in the output.

Recommendation and search systems rank items by the dot product between a user vector and every item vector — one user against millions of items, many times per second. That contraction is the ranking signal. Sum over the wrong axis and every user gets wrong results.

Study here, then run the real thing: notebook 06 on Colab · the handbook · Kahoot 2

Built from the workshop’s own material by Ravi Kalia and Sebastian Laverde Chunza, CC BY 4.0.

9 topics1 tag
Study this deck
Learning tools

Choose how to study

See all 5 tools
The content

Explore the topics

Read it all?

Rapid repetition replays exactly what you forget — the fastest way to lock it in before the exam.

Try rapid repetition