Hacker News new | ask | show | jobs
by usamec 4517 days ago
"2) it demystifies machine learning -- you have to write your ML from scratch, without the help of all those wonderful Python libs, and I think this exercise shows you that it's not so mysterious after all." - you can demystify machine learning in any better language.

JS and PHP are slow, crappy and bug prone. Sane languages (like Python, C++) have tools to make your job easier (like numpy, blas, eigen and other libraries). They provide fast and reliable math routines so you don't have to worry about some eigenvalue decomposition, matrix multiplication and other problems.

2 comments

I'm not sure I understand the point you're trying to make. Are you telling me I should not have written this series? That it's somehow not valuable because you don't like JS? That I can't effectively teach basic machine learning concepts to interested people without forcing linear algebra onto them? That, as a teacher, I can't try to use any and all tools and techniques available to the group I'm trying to teach?

I've even explicitly mentioned that I'm staying away from algorithms that rely on linear algebra, because I'm trying to bring these concepts to people who may not have a CS or mathematical background.

JS isn't particularly slow any more, thanks to the massive efforts invested in the optimization of the various competing JS engines. It is generally faster than Python 3 (http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te...) and not just a little. Just for the hell of it I compared node and python on naive fibonacci. That is anecdotal, of course, but node is 30 times faster. I do agree with you that JS has horrid, bug-prone semantics, but it's impressively well optimized.

I also agree that other languages offer better tools. For instance, Python has Numpy. However, that's written in C++, not in Python. You can write plugins for Node in C++ too, so nothing would stop someone from writing a Numpy equivalent for JS. You might even be able to run it in some browsers through something like Emscripten with a performance overhead of 2-3x (I think?)

Let's not forget webCL. Gpu based matrix multiplication is available in javascript too.