Re:Show HN: Word2vec Algorithm in ~100sloc with NumPy
by CamperBob2 on Thursday June 01, 2023 @01:17PM
(#36154286)
Sometimes Python's conciseness works against its value as a didactic language.
[ Parent
| on HN ]
Re:Show HN: Word2vec Algorithm in ~100sloc with NumPy
by Y_Y on Thursday June 01, 2023 @01:28PM
(#36154466)
The original code looked like someone had learned old-school C++ and just shoehorned that into python. This phenomenon is all over physics. The fixed code isn't just short, it's idiomatic and clear (YMMV) and hence much easier to understand.
Re:Show HN: Word2vec Algorithm in ~100sloc with NumPy
by nine_k on Thursday June 01, 2023 @01:59PM
(#36154905)
Reasonably modern C++ would allow you to define a Counter class, and to define maps and filters, if the stdlib versions don't work for you for whatever reason.
Fortran, on the other hand,...