Live data from Hacker News

Machine Learning Library for C++

image.diku.dk

21–30 of 52 posts

Re: Machine Learning Library for C++

#21
post #18

Earlier quoted context omitted.

If the OP was thinking of writing his own algorithms, and this is a linkable library with that heavy math already implemented, couldn't he write bindings for Python/Lua/Tcl/Ruby and have everything he needs for script-ability, or am I missing something?

You aren't missing anything, you are absolutely correct, but the question isn't "can they?" the question is "will they?"

I'm in the Stanford/Coursera machine learning course right now, and something like this is nearly excactly what I've been looking for.

As some others have said, GPLv3 is off-putting, but there is the LGPL mlpack lib (http://www.mlpack.org/) (also C++). Personally, project-wise, the only way this could be improved is if the project were pure C, and a BSD, MIT, or similar license. Quite looking forward to checking these out, though.

Re: Machine Learning Library for C++

#22
post #7

Earlier quoted context omitted.

Speaking as a PhD student in machine learning- Implement the algorithm yourself, first, in Python+Numpy. The only reason I feel comfortable with Gaussian Processes and SVMs is due to writing code to solve them manually. Once you're happy with the basics, and can test your ideas with code you intimately understand, optimise for speed by using a library like this.

Implementing the SVM from scratch was time consuming - no?

Yes it was :) but time well spent imo.

On reflection I guess I might have had more free time to spend on this than a normal person - I did the SVM as a [small] part of my masters project, so if you're time constrained with a real job and a life then might be best to disregard me.

Re: Machine Learning Library for C++

#23
post #2

The library supports some very useful algorithms. Both supervised and unsupervised ones. But I can't use it for our commercial non GPL projects.

Flame Suit On / Rant Mode On I actually really don't understand why anyone uses GPL for a library. I've been doing open source for a long long time, and love the GPL. I have code in the Linux kernel, and believe free software AND open source software are great solutions to very real problems in software engineering. Having open code just gives people more options, and I firmly believe it will win over time as far as…

LPGL isn't vastly better than the GPL as it makes it difficult to link statically and/or release for closed platforms. Its advocates would probably see these as plus points, but I'm not sure that they're going to increase uptake.

Re: Machine Learning Library for C++

#24
post #2

The library supports some very useful algorithms. Both supervised and unsupervised ones. But I can't use it for our commercial non GPL projects.

Flame Suit On / Rant Mode On I actually really don't understand why anyone uses GPL for a library. I've been doing open source for a long long time, and love the GPL. I have code in the Linux kernel, and believe free software AND open source software are great solutions to very real problems in software engineering. Having open code just gives people more options, and I firmly believe it will win over time as far as…

Limiting choice is BAD. The whole reason you should be creating and using free software and OSS is to not weld the hood shut.

But you sound like you want to limit choice for users. The whole point of free software from the GNU perspective is to keep options open for users, and not allow downstream devs to "weld the hood shut" on derivatives by adding more restrictions on what users can do with those derivatives.

However, there are other reasons people choose it as well. One motivation you sometimes encounter is a view that, if someone's code is used in proprietary, commercial software, they'd like to be paid for it. Hence the dual-licensed model used by libraries like Qt and the Stanford Parser: you can use the GPL version if you're willing to GPL your own app, or you can buy a proprietary license if you aren't. Seems reasonably fair: I give you my code free if you reciprocate and do likewise with your own code, or I sell you a license for cash otherwise.

Re: Machine Learning Library for C++

#25
post #21

Earlier quoted context omitted.

You aren't missing anything, you are absolutely correct, but the question isn't "can they?" the question is "will they?"

I'm in the Stanford/Coursera machine learning course right now, and something like this is nearly excactly what I've been looking for. As some others have said, GPLv3 is off-putting, but there is the LGPL mlpack lib ( http://www.mlpack.org/ ) (also C++). Personally, project-wise, the only way this could be improved is if the project were pure C, and a BSD, MIT, or similar license. Quite looking forward to checking th…

honestly you guys are crazy if you think shark is gonna help you learn machine learning. Its ideal for deployment of ML on things like embedded computer, robotics, games etc. where real time learning is required. Machine learning requires alot of experimentation and C++ is a terrible medium for that. There are loads of good machine learning libraries implemented for python and matlab. Pretty much every good paper in machine learning is accompanied by an algorithm implemented in matlab or python or R. learn using those reference designs. Once you figured out what you want, then deploy on a system in C++ by all means using shark. I do robotics for a living, and I do go from scripting to C++. Unless its absolutely necessary I avoid C++. Only things like vision which is so CPU hungry that it has its own computer do I require C++, every other algorithm stays in python.

Re: Machine Learning Library for C++

#27
post #23

Earlier quoted context omitted.

Flame Suit On / Rant Mode On I actually really don't understand why anyone uses GPL for a library. I've been doing open source for a long long time, and love the GPL. I have code in the Linux kernel, and believe free software AND open source software are great solutions to very real problems in software engineering. Having open code just gives people more options, and I firmly believe it will win over time as far as…

LPGL isn't vastly better than the GPL as it makes it difficult to link statically and/or release for closed platforms. Its advocates would probably see these as plus points, but I'm not sure that they're going to increase uptake.

Difficult, but not really a significant part of the challenges for delivering closed source binaries across platforms.

On linux, you have to build distribution specific binaries that match the shared library versions in the package manager.

On Windows, you generally put all of your shared libraries in your application's folder, since there are plenty of bad actors who install DLLs without versions in the filename to system32. Leads to duplication on the system but its a generally accepted bad practice.

(Can't speak to shipping LGPL libs on OS X).

Re: Machine Learning Library for C++

#28
Very interesting, but as a daily practitioner I am skeptical.

First, this is a lot of code! As a C++ machine learning programmer, I am impressed as I know the pain (someone explains why, see comment https://news.ycombinator.com/item?id=5613797 ).

Second, it contains a version of Blas and ublas as well as LBFGS and more, much more, coded from scratch as it seems. This seems too much for an ML library, and a lot to maintain.

This makes me skeptical of performances and maintenance of the code, but it would be fairer to try it first.

Still very impressed.

Re: Machine Learning Library for C++

#29
post #21

Earlier quoted context omitted.

I'm in the Stanford/Coursera machine learning course right now, and something like this is nearly excactly what I've been looking for. As some others have said, GPLv3 is off-putting, but there is the LGPL mlpack lib ( http://www.mlpack.org/ ) (also C++). Personally, project-wise, the only way this could be improved is if the project were pure C, and a BSD, MIT, or similar license. Quite looking forward to checking th…

honestly you guys are crazy if you think shark is gonna help you learn machine learning. Its ideal for deployment of ML on things like embedded computer, robotics, games etc. where real time learning is required. Machine learning requires alot of experimentation and C++ is a terrible medium for that. There are loads of good machine learning libraries implemented for python and matlab. Pretty much every good paper in…

Dear person:

> Machine learning requires alot of experimentation and C++ is a terrible medium for that.

Is it really? I suspect you do not know how to use C++ effectively. Why not try parameterizing your machine learning algorithms with templates? That way, you can plug in different loss functions, different regularizers, different metrics, or different initialization routines without having to modify your internal algorithm code. In addition, because you are using templates, it is bound at compile time, so you don't pay the vtable lookup penalty that you do with inheritance.

Python might be better for your uses, and I can respect that, but don't tell people that C++ is a terrible way to implement machine learning algorithms when you actually are just ignorant of how to do it well.

Re: Machine Learning Library for C++

#30
post #29

Earlier quoted context omitted.

honestly you guys are crazy if you think shark is gonna help you learn machine learning. Its ideal for deployment of ML on things like embedded computer, robotics, games etc. where real time learning is required. Machine learning requires alot of experimentation and C++ is a terrible medium for that. There are loads of good machine learning libraries implemented for python and matlab. Pretty much every good paper in…

Dear person: > Machine learning requires alot of experimentation and C++ is a terrible medium for that. Is it really? I suspect you do not know how to use C++ effectively. Why not try parameterizing your machine learning algorithms with templates? That way, you can plug in different loss functions, different regularizers, different metrics, or different initialization routines without having to modify your internal a…

C++ isn't a terrible medium for experimentation. Games and every "creative coding" interactive projector art type project are done in C++.
Post reply on HN