Hacker News new | ask | show | jobs
by czbond 1487 days ago
Question: Why was the original version in Matlab? I am familiar with Python, R, and others.... I get that those languages until recently might not have been great over the ancient predecessors (LISP, etc) for ML related.

But I've never seen actual production anything in Matlab. Did Matlab provide something at the time others did not? If so, how did they transfer MatLab to running production models? Or did they create a model with basic outcomes - and then code a representation of it in C++, etc?

1 comments

Before Python (Numpy/Scipy) really came into its own (which didn't quite happen until early 2010s), Matlab was among the easiest-to-use scripting languages for writing scientific computing programs. I was in university (Bachelor's + Masters) from 2007-2012 and learned Matlab extensively in my numerical computing classes (I was a Physics major, for what that's worth). When you're ready to run your scientific computing codes on a supercomputer cluster, you'd usually rewrite it in C++ or Fortran (my research group used the latter), but to develop and debug at a small scale, you'd usually use Matlab, although the younger people like me might use Numpy, and there were one or two people who used Mathematica even for numerical computing (as opposed to symbolic algebra, which everybody used Mathematica for).

It was around the time I was in university that Python really matured for numerical computing, but professors (as opposed to grad students) were likely to be already familiar with Matlab, so there wasn't much reason for them to learn Python. Andrew Ng was already a mid-career researcher when he made his course, which was probably based on older materials (I also learned basic neural networks in my numerical computing class in 2008), so it made sense for him to continue to use Matlab, especially because Octave exists as an open-source reimplementation of the basic functionality.

These days, you wouldn't use anything else but Python for ML, at least until you really productionize the implementation at a large scale, at which case you might rewrite in C++ or Rust (I don't know if they even bother rewriting these days when most of the computation happens in GPUs or TPUs). And it's my understanding, although I'm not really too familiar these days, that Matlab has mostly pivoted into providing a toolbox of all sorts of esoteric numerical methods for engineering-related tasks like finite element analysis, as well as hardware simulation (using Simulink).

Well, matlab didn't pivot into that esoteric toolbox of numerical methods for engineering tasks. It has always been that. That's probably the very reason ML researchers picked it up in the first place, because everyone was using it already anyway for scientific (esp. linear algebra) calculations.

I've done my degree a bit before you (in Electrical Engineering, also learned all I could about NN and other AI methods back then) and most people would use MATLAB for whatever scientific algorithms/calculation they needed to do. We had free student licences at the university so that we could use it for lab work and for our theses. I remember it had all kinds of numerical optimization algorithms/packages, control theory algorithms, etc.

@telotortium - hey thank you so much for adding that context, it is incredibly helpful. Now I can internalize why it was Matlab. The update to python is going to scale it to a new level of learners!