Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

amazing at consolidating my code into something more readable

Readable if you're already familiar with einsum notation. Otherwise there's learning curve. An alternative to einsum is using multiple dot product and reshape ops, hopefully with each one having a comment - this would be a lot more readable imo.



But then to find some mistake you would have to corroborate n * 2 pieces of information, which is quite a bit more, before getting into the issue of whether or not the sequence of operations actually makes sense on top of all that.


So let’s say there’s a bug, and an einsum statement is a suspect. Assume I’m not familiar with einsum notation, but I know dot products and reshapes. How do I debug it?


Guess you can’t, then. Personally I’m a bigger fan of einops since the variable/index names can be a lot more self-documenting.


I really don't find that einsum is less intuitive than reshape. Maybe they both take about the same time to learn the first time. And that's less time than it would take me to struggle through even a single function using reshape ops.


How many DL people are familiar with dot products and reshapes, and how many are familiar with einsum?


I really couldn't say.

It does occur to me, though, that you are probably talking about the elementwise product, not the dot product. The dot product includes a reduce_sum step and outputs a scalar.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: