5 ms·
It's super sad to me, that the only convenient cross platform way to do deep learning is a hack on top of JS.
by Houshalter 9y ago
It's super sad to me, that the only convenient cross platform way to do deep learning is a hack on top of JS.
- connorelsea 9y agoNot sad - this is the beauty of modern JS.
- state_less 9y agoI've been waiting years for this. Once compute shaders became available to the browser I planned to finally get around to writing some code because you could project out to so many platforms. This sucks the entropy out of the coding task. You don't have to have multiple implementations, with unique bugs on multiple platforms. JS has improved over the year but you can also go with a typed language if you wanted like purescript or typescript.
- state_less 9y agoI guess I'll have to keep waiting, this isn't using compute shaders apparently.
- nsthorat 9y agoWhy wait?
- state_less 9y agoI guess I targeted compute shaders in the browser as a good time to revisit linear algebra and ANN since I could expect improved performance, improved programming model and improved portability. You have created an abstraction that is pretty portable. You'll probably be able to capture new performance enhancements as they occur on web runtimes. Maybe I'll try it out.
- jorgemf 9y agoWhen you want performance the only way is getting close to the hardware. That is why deep learning is usually linux+nvidia. That is why game engines use/used C or even assemble code for critical parts. Don't expect anything better soon as companies focus on performance per watt and will only develop things in that path.
- nsthorat 9y agoOr you improve your algorithms and use the existing hardware (think distributed computing on cheap HDDs).
- jorgemf 9y agoCompanies will improve the algorithms and go low level with hardware instructions. The problem with GPUs is that they have special instructions for some operations. Not using them can be 20 times slower. You are not going to improve the algorithms 20 times, ND if you do you can still improve it another 20 times with hardware instructions. You do both if you can. That is a big saving in electricity in data centers.
- j2kun 9y agoFolks are downvoting this, but they must clearly have drowned themselves in kool-aid. You want fast matrix multiplication? Pretend you're doing texture shading in a language primarily used for dynamic web frontends!
- Houshalter 9y agoYeah I don't see how I stepped on any toes. Deep learning libraries have always been a pain in the ass to install. And only support some OSes and GPUs. There's nothing wrong with JS or webgl, but it seems an incredibly inelegant choice for this.
- lettergram 9y agopip install tensorflow is pretty darn easy.... Granted it doesn't have AMD support, I'm fairly confident even the CPUs can out perform the javascript library.
- Houshalter 9y agoI wasn't aware it worked at all on Windows now, that's cool. Doesn't seem very simple to install though. This is the installation guide for just one of the prerequisites: http://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/ http://docs.nvidia.com/cuda/cuda-installation-guide-microsof... And as you mention, only Nvidia.
- Rapzid 9y agoCuda and cuDNN; good times :) Not cross platform, but nvidia does supply a bunch of packages now for different OS's to get that stuff installed.
- banachtarski 9y agoWhy pretend? A texture is just an array of floats. The thing preventing you, the programmer, from seeing it as something beyond an "image" is really yourself. In modern graphics, we use textures to represent all kinds of data. Projections onto different spherical harmonic modes, luminance histograms, atmospheric data, etc. A texture is just data and a shader mutates that in a highly parallel way with specific coherence semantics. Before knocking it, I suggest educating yourself a bit more.
- mr_toad 9y agoI'm not sure how convenient this will be for most use cases. JavaScript in the browser lacks good data manipulation libraries (nothing that comes close to using Pandas, or R). Even loading/saving files with the browser is a PITA (by design really, for security reasons). I can see a day when JavaScript (or web assembly) has APIs like Numpy and Pandas, but for now It's simply easier to install one of those than try and do everything in JavaScript.
- Houshalter 9y agoPresumably this will usually be run from a JS engine like Node independent of a browser. Which will have all the libraries needed for loading data and such. In theory it will be an order of magnitude faster than numpy because it uses the GPU (I don't know what the actual performance is though.) Certainly the JS will be much faster than python or R.
- mr_toad 9y agoDeeplearn.js is designed for webGL on a browser. I'm not sure if it'll work in Node. And on a server you'd probably want to target OpenCL. Node adds file support, but libraries for stuff like dataframes are still in their early days. That might not be a problem for example problems, but real world data needs cleaning up before you can start doing ML.
- nsthorat 9y agoIt doesn't work in node yet, a relevant issue: https://github.com/PAIR-code/deeplearnjs/issues/234 https://github.com/PAIR-code/deeplearnjs/issues/234