5 ms·
Why do you think they wrote it in Matlab?
by bronz 11y ago
Why do you think they wrote it in Matlab?
- chucksmash 11y agoI assume the first paragraph of the README: > Matlab source code for one-shot learning of handwritten characters with Bayesian Program Learning (BPL).
- omginternets 11y agoI think the question is "why did they select Matlab as their language".
- bronz 11y agoI think you misread my question or something.
- sabertoothed 11y agoI think he read correctly. You phrased it poorly.
- omginternets 11y agoShort answer: because everybody uses Matlab in research. - Lots of libraries - Nice graphical interface - Lots of online help - Matrices as a first-class citizen I hate Matlab as much as the next guy, but it's deeply ingrained in academia.
- bronz 11y agoSomeone down-voted me just for asking. I have no idea about any of this stuff and I was just genuinely curious. Apparently people are pretty polarized about Matlab. Thanks for explaining that to me.
- omginternets 11y ago>Someone down-voted me just for asking. People take the internet way too seriously :/ >Apparently people are pretty polarized about Matlab Yes, very much so. Much of the contention comes from the obscene licensing prices coupled with the fact that its a terrible language.
- tormeh 11y agoA terrible language with awesome libraries. In the language wars, libraries are king. I hate Matlab, but I've got to admit that the toolboxes are without peer.
- pmoriarty 11y agoPerl had tons of awesome libraries. Yet Python, Ruby, and Go, which had virtually none compared to Perl when they started still became very popular, and are arguably more popular than Perl now.
- daveguy 11y agoIncredible libraries, yes. But you may want to check out python with numpy, scipy, pandas, scikit-learn, etc. There are bundles like python (x,y) that bring them all together. Probably still want to stick with python 2.7 though (as most of scientific computing still does). This removes the tedious stumbling block that is forced unicode.
- Maken 11y ago>obscene licensing prices You can always use Octave.
- david-given 11y agoIt may be nitpicking, but the phrase you used ('Why do you think X?') is very common for making passive-aggressive contradictions. ("I have a smart cat." "Why do you think cats are smart?") If you've been hanging around the internet for a while you tend to start seeing an unspoken 'you idiot' on the end of it, even when it's not there. You could well have been downvoted more or less on reflex because of that.
- TeMPOraL 11y agoI'd add: - That's what they teach you when you're a student.
- torrionep 11y agoComplete agreement - grad students have a few jobs they need to do and need to do quickly: 1) Large (within reason) easy matrix manipulations. MATLAB is fantastic at this. Matrices as first-class objects is so important, I don't know why more languages don't include them (though I am pleasantly unaware of the complications inherent to this). 2) Simple, decently pretty visualizations of data. 3) Trivial syntax. If you've programmed at all, it's easy to read MATLAB syntax. IMO, the only threat to MATLAB on the horizon for academic work is Python + the associated SciPy tools (sckikit-learn, etc); especially as bundled in SPYDER, which I have had a blast with. But since cost is typically not an issue at a university (MATLAB is paid for by someone else), and everyone already speaks MATLAB, there's not a real impetus to change. (Julia may be int he running, too, but SPYDER seems more user friendly at this point) Also, as someone who's been through this a dozen times before - as soon as a professor says "make me this visualization, the command in MATLAB is this" and the grad student says "SciPy (or whatever) doesn't have that", that student is converting his data to a text file, reading it into MATLAB, and making that damn plot :)
- a-dub 11y agoMATLAB is a terrible programming language. MATLAB is a fantastic workbench for exploring data and implementing numerical algorithms. There's a lot of excitement around the numerical computing tools that have sprouted up around Python, but I find the visualization capabilities to be lacking and writing numerical code in Python is really quite clunky where the same expressions in MATLAB are much more clear and concise. In short: If you're writing lots of loops and conditionals, MATLAB is the wrong tool. If you're analyzing data, applying linear algebra or exploring using the tools of mathematics, signal processing and machine learning... it really can't be beat. Everything is just there, everything just works, everything is very well documented and there's a MATLAB implementation of everything new. Only bummer is that it's expensive.
- orbifold 11y agoMy guess is that most of the general purpose programming languages are usually poorly suited in one way or another for domain specific programming. Matlab has a large standard library and a reasonably well integrated development environment. Its language and library ecosystem is also adapted to the domain the authors are working in. Scientific libraries in other languages come close or maybe surpass them, but it is still the de facto standard in certain parts of scientific computing. The only reasonable alternative I can think of is IPython / Anaconda with the right set of libraries or maybe Julia, which borrows heavily from Matlab, both however don't offer all of the IDE features that a typical Matlab user maybe takes for granted. Other languages like C++ are usually excluded by default because of their obvious very poor suitability for rapid exploratory programming.
- nemoniac 11y ago> My guess is that most of the general purpose programming languages are usually poorly suited in one way or another for domain specific programming. For this reason, Lisp would be ideal for this.
- orbifold 11y agoIn an ideal world maybe, but in reality if the fraction of (hours invested in actual project)/(hours invested in fixing tooling, write high quality easy to use libraries for data visualisation, data import / export, linear algebra, optimisation, statistics etc.) approaches zero, then a language probably won't be used. Also in this case the syntax of Matlab and the convenience with which you can manipulate indexed expressions with it, would probably not easily trumped even by a dsl embedded in Lisp, not without significant investment in developing such a domain specific language.
- eli_gottlieb 11y agoBecause Church (probabilistic Scheme) has been mostly discontinued, and Venture (the next big MIT probabilistic programming language) is currently somewhat hard to work with. Go try out the release tarballs and see.
- nextos 11y agoWhat do you think about alternatives? Like Anglican.
- eli_gottlieb 11y agoLooking at the latest release of Anglican, it looks awesome. I'm quite happy to see a PPL actually being maintained that still uses a functional-style `query` (allowing conditional distributions to be Yet More Distributions) instead of the imperative observe-infer programming from Venture.
- nextos 11y agoYeah, it's also quite nice it's Clojure, so full JVM stuff at disposal.
- argonaut 11y agoAs someone who has done a little bit of recent research in AI, pretty much everything high-level (new experiments, new models) is in MATLAB or Python (the exception is C/C++/Cuda if an algorithm or system must be implemented from scratch performantly). All the libraries are in those ecosystems. It really has nothing to do with syntax, performance, ease-of-learning, quality of IDE, concurrency support, online tutorials, quality of documentation, etc. Computer vision in particular is dominated by MATLAB because of its superior image/signal processing libraries. This may change as deep learning takes over computer vision (deep learning is dominated by (Python or Lua) + C++/Cuda).
- michael_h 11y agoI find OpenCV to be a far better alternative to MATLAB for image processing and CV work. The API's are extremely similar and when things don't work the way you expect, you can modify OpenCV to fit your needs. Plus, if you're a grad student and you write it in C++/Python with OpenCV, your algorithm might finish before it's time to graduate.
- sjtrny 11y ago> your algorithm might finish before it's time to graduate MATLAB is quite fast at vectorised and matrix operations. For things that are slow you can write your own C/C++ function and call it from within MATLAB.
- fnordfnordfnord 11y agoIn addition to the advantages of Matlab mentioned by others, a lot of uni/college freshman level (and even upper level) STEM curricula include one or more courses involving Matlab. They've gotten themselves included in a few textbooks as well.
- laughfactory 11y agoThat's awesome that Matlab is such a good expensive product. Personally I'm an open source guy all the way so I support R and Python (and Julia, I suppose) at every opportunity. Yeah, maybe there are some rough edges, but my thinking is that since they're good enough at this point, I can work around those rough edges...and I anticipate that hundreds of thousands of users will eventually drive them to being as good or better than any commercial offering. Take SAS, for instance, I don't like it--largely due to the fact that it's so expensive most companies don't upgrade until they absolutely have to. So you'll run into lots of employers running a very old version of SAS (like 9.2), without any of the extensions which help you solve problems and be more productive. So when I started my new data science-ish job at my current employer and had the option of which tools to use for machine learning and modeling I chose R and Python. But to each their own. I just dislike contributing to the market share of software I could never afford to run on my personal computer.
- fnordfnordfnord 11y agoI'm in agreement with most of the things you said, and I wasn't really meaning to advocate for Matlab; but rather just to point out another reason why someone might choose it. I used it in college, and at one company I worked at. It was much nicer to work with than LabView. I appreciated the hand-holding I got from Matlab, but eventually became competent enough to do my job in several languages, mainly Python. >I just dislike contributing to the market share of software I could never afford to run on my personal computer. I agree and that's one reason I tend toward OSS in courses I teach now, unless there is no practical alternative.