[HN Gopher] A basic introduction to NumPy's einsum
___________________________________________________________________
A basic introduction to NumPy's einsum
Author : s1291
Score : 25 points
Date : 2022-04-09 21:47 UTC (1 hours ago)
(HTM) web link (ajcr.net)
(TXT) w3m dump (ajcr.net)
| cschmid wrote:
| I'd really like to use einsum more often, because it allows me to
| code my expressions the same way I derive them on pen and paper.
| Unfortunately, as mentioned in the article, it's slow, because it
| converts your formula to a for loop.
|
| So usually, I rewrite my formulas into messy combinations of
| broadcasts, transposes and array multiplications. Is there a
| package or an algorithm that does this conversion automatically?
| It seems to be a pretty straightforward problem, at least for
| most expressions I use.
| machinekob wrote:
| I would say https://github.com/arogozhnikov/einops should be
| pretty close to your requirments
| polygamous_bat wrote:
| I would like to second that! I converted multiple of my lab
| mates into Einops just by having them browse through the
| tutorial in https://einops.rocks/ :)
___________________________________________________________________
(page generated 2022-04-09 23:00 UTC)