5 ms·
I have found that most difficult thing about doing machine learning in Go is the lack of a really good matrix library. I always just end up using Python because
by timtadh 12y ago
I have found that most difficult thing about doing machine learning in Go is the lack of a really good matrix library. I always just end up using Python because I end up wanting to do something like "find eigenvectors." Easy in Python but no one has yet wrapped up a nice interface into the BLAS/LAPACK libraries to do this from Go. (That I know of! If you know a good library for this let me know!!!!)
Numpy and Scipy are so mature in this respect it is difficult to compete with them. I looked into implementing eigenvalue algorithms recently with the idea that I would just write a native Go library for doing this kinda stuff. However, reading the source of JAMA[1] was sufficiently humbling for me to realize this was not a good idea. (If you really want to be humbled try reading the fortran implementations in LAPACK.[2] I believe SRC/dgeesx.f is a good starting point)
[1] http://math.nist.gov/javanumerics/jama/ http://math.nist.gov/javanumerics/jama/
[2] http://www.netlib.org/lapack/#_software http://www.netlib.org/lapack/#_software
- Osmium 12y ago> Numpy and Scipy are so mature in this respect it is difficult to compete with them. Tell me about it. What I'd give to have something equivalent for Objective-C (or certain other languages too, e.g. Julia). I'm looking at PyObjC as a stop-gap solution for now, but it sure adds complexity to a project. Edit: Since SciPy is BSD-licensed and presumably mostly C behind-the-scenes, perhaps there's potential for a group to try and package it up for other languages? I have no idea how large an undertaking like that would be...
- timClicks 12y agoAt least with Julia's PyCall, you don't need to sacrifice losing access to the Python stack. You can work with NumPy arrays without needing to copy data around.
- Osmium 12y agoThanks! I didn't realise this. This looks really useful.
- dapz 12y agoGNU Scientific Library? I've not benchmarked it against Numpy/Scipy, but there is quite a bit of overlap in functionality.
- Osmium 12y agoIt looks great. Sadly doesn't have the specific tools I need, and regardless the license is prohibitive if I ever wanted to publish something on the App Store (regardless of if I open sourced it myself), so it's not really an option. Not that that's GSL's fault of course.
- waitingkuo 12y agoThe author of numpy is making the next generation numpy, blaze (http://blaze.pydata.org/docs/index.html http://blaze.pydata.org/docs/index.html). There're also many python project, such like numexpr, blz, numpy aim to boost scientific computing in python. Having a strong community, I think python might dominate the data analysis in the nearly future.
- simscitizen 12y agoiOS and OS X ship with Accelerate.framework, which include implementations of BLAS and LAPACK: https://developer.apple.com/library/mac/documentation/Accelerate/Reference/AccelerateFWRef/_index.html https://developer.apple.com/library/mac/documentation/Accele...
- Osmium 12y agoThanks – sadly, for myself, the algorithms I need aren't part of Accelerate (I've most recently been using SciPy for its spatial algorithms). The benefit of SciPy is that there's just so much breadth, along with an easy way of moving data between different parts of SciPy, and good documentation too. There's just nothing else like it that I know of.
- burntsushi 12y agohttp://godoc.org/github.com/gonum/matrix/mat64 http://godoc.org/github.com/gonum/matrix/mat64 https://github.com/gonum/blas https://github.com/gonum/blas I don't know how mature they are though.
- timtadh 12y agoOoo. I had not seen mat64 before. That looks very interesting. I believe I need LAPACK on top of BLAS with respect to the BLAS lib. Thanks for the pointers! EDIT: The lack of README and documentation beyond the API docs concerns me for mat64. still a pretty interesting project. Might be useful for non-critical stuff.
- howeman 12y agoI am one of the developers, and at the moment I wouldn't use it for critical stuff. We would like it to be good (not just functional) and that takes time. We are not in "1.0" stage yet, and we make backward incompatible changes from time to time. Specifically, if the proposal for tables is accepted, the package will change a lot (and it will be awesome). The CBLAS package should work well, and I believe all of the goblas functions that are there have good tests. In my opinion, Mat64 needs a lot of work before it is a "premiere" package (a bunch is missing and a bunch is slow). That said, I use it in my work and many parts of it are good. We are interested in making it better, but it's entirely volunteer and it all takes time. It would be great to have people providing code/documentation/bug reports, so I encourage you to use it in non-critical stuff.
- skj 12y agoWhen Go was released, back in 2009, I decided I wanted to use it for my machine learning experimentation software (I was year 4 of a PhD program). There was no matrix library, so I created one: https://github.com/skelterjohn/go.matrix https://github.com/skelterjohn/go.matrix
- sirseal 12y agoThere's a BLAS/LAPACK interface in biogo. https://code.google.com/p/biogo/ https://code.google.com/p/biogo/ The maintainers had plans to turn that part into a standalone library. I have no idea on progress.