TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Einsum Is All You Need – Einstein Summation in Deep Learning (2018)

147 pointsby aleyanover 6 years ago

7 comments

yorwbaover 6 years ago
The problem with einsum is that you have to explicitly specify the mapping between dimensions and indices every time, without any way to enforce consistency. It would be more ergonomic if each tensor had labeled dimensions. That would prevent the kind of silly mistake where you mix up the ordering of dimensions and only notice it when you later change the shape of the tensors so the different dimensions no longer match up.
评论 #19066900 未加载
评论 #19068532 未加载
评论 #19067180 未加载
评论 #19070063 未加载
评论 #19068857 未加载
评论 #19067453 未加载
Xcelerateover 6 years ago
I remember when I was learning matrix calculus and realized at some point that it was <i>much</i> simpler to convert everything to index notation, perform all operations, then convert everything back to standard notation at the end. It became almost comically simple, because you&#x27;re &quot;just&quot; working with labeled scalars at that point. To be fair, it&#x27;s convenient to memorize some of the more commonly used expressions (like ∂tr(AB)&#x2F;∂B) rather than rederive them from scratch.
评论 #19068114 未加载
评论 #19069086 未加载
staredover 6 years ago
Right now I work on Tensor diagram notation for deep learning (for project &quot;thinking in tensors, writing in PyTorch&quot;).<p>To read more about it, see: <a href="https:&#x2F;&#x2F;medium.com&#x2F;@pmigdal&#x2F;in-the-topic-of-diagrams-i-did-write-a-review-simple-diagrams-of-convoluted-neural-networks-6418a63f9281" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;@pmigdal&#x2F;in-the-topic-of-diagrams-i-did-w...</a> (obviously, I refer to the post).<p>And if you want to create some, here is a short demo: <a href="https:&#x2F;&#x2F;jsfiddle.net&#x2F;stared&#x2F;8huz5gy7&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jsfiddle.net&#x2F;stared&#x2F;8huz5gy7&#x2F;</a><p>In general, I want to expand that to tensor structure (e.g. n, channel, x, y) plus, translate it to the Einstein summation convention.
joppyover 6 years ago
I&#x27;ve never really understood the point of Einstein notation, as a piece of mathematical notation. Is writing something like A[i, j] * B[j, k] really that much faster than writing something like Sum[j](A[i, j] * B[j, k])? Especially when you have to check the left hand side of the equality sign just to know which indices to sum over, it seems like making things less clear for a minuscule saving on ink.
评论 #19067708 未加载
评论 #19067641 未加载
评论 #19067575 未加载
评论 #19067460 未加载
评论 #19068750 未加载
评论 #19069249 未加载
thecleanerover 6 years ago
Awesome examples. However einsum fails to express convolutions. Also functions that are applied element wise such as the sigmoid and softmax. All three are crucial in deep learning.
TTProgramsover 6 years ago
How do you einsum convolution? Arguably the single most important linear operation in deep learning?
评论 #19068416 未加载
评论 #19068241 未加载
mlthoughts2018over 6 years ago
Looks like this is a re-post of the same link from this somewhat recent post: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16986759" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16986759</a>