5 ms·
I don't understand: how is this better than/different from python (with numpy, scipy, theano and FFI)? Is this a language preference thing where people just wan
by conistonwater 12y ago
I don't understand: how is this better than/different from python (with numpy, scipy, theano and FFI)? Is this a language preference thing where people just want to avoid python?
- fchollet 12y agoIt is essentially a Lua equivalent to Theano. A significant difference, though, is that it makes running your NNs on GPU extremely easy. Also, it is endorsed by the main deep convnets research groups (Facebook, Google).
- deanjones 12y agoWhat specifically do you find not-so-easy about running Theano (or rather, a NN library built on top of Theano) on GPUs?
- benjaminva 12y agoThanks to Luajit, the code you are writing will be compiled to efficient byte code which runs very fast. It's because Lua as a language is simple enough to produce light bytecode that can run in the CPUs cache. Numpy will always do the job, but when speed is really critical, you might want to look into it.
- ludamad 12y agoSpecifically, LuaJIT has a very well-designed bytecode optimized for decoding and with specialization for types. The bytecode dispatch is hand-written in assembly which exploits this. And this is all even if your code never sees a JIT -- LuaJIT JIT'd numerical code is competitive in microbenchmarks.
- deanjones 12y agoI'm not an expert in LuaJIT, but it sounds unlikely that the performance characteristics of torch7 are due to the efficiency of Lua bytecode. The speed with which you can train NNs will be dominated by the performance of the linear algebra libraries which are utilised by the numerical optimisation algorithms (SGD, L-BFGS and the like). Almost everyone ends up using some variant of the BLAS libraries for this.
- smhx 12y agoSomeone I met recently said this (in rough words): "When I'm writing rough code in lua, it's completely acceptable to do a couple of for loops here and there without a disaster in speed. With python, this was a complete meltdown" I'm not saying it all boils down to just this quote, but I thought it was interesting and wanted to replay it here.
- ravich2_7183 12y agoThis is true, but there are a couple of easy workarounds for it: Cython and scipy.weave http://wiki.scipy.org/PerformancePython http://wiki.scipy.org/PerformancePython
- pwang 12y agoWe're making progress on that front with Numba: http://numba.pydata.org http://numba.pydata.org