this post was submitted on 22 May 2025
5 points (100.0% liked)

dynomight internet forum

72 readers
5 users here now

dynomight internet forum

founded 10 months ago
MODERATORS
top 2 comments
sorted by: hot top controversial new old
[–] m_f@discuss.online 1 points 6 hours ago (1 children)

Great follow-up to "I don't like NumPy", it's always better to show by example how things could be better. Minor nit, it would be nice if the different code samples at the end were displayed side-by-side somehow. Also wondering if the assert x.ndim == 1 in softmax_dumpy somehow meaningful? The other examples, including "DumPy (alternate)", don't have that check.

[–] dynomight@lemmy.world 2 points 5 hours ago

At one point, I actually had some (LLM-generated) boxes where you could click to switch between the different implementations for the same problem. But in the end I didn't like how it looked, so I switched to simple expandy-boxes. Design is hard...

There's no magical significance to the assert x.ndim==1 check. I think I just wanted to demonstrate that the softmax code was "simple" and didn't have to think about high dimensions. I think I'll just remove that, thanks.