News for hackers. Stuff that matters.
Re:Neural Networks in JavaScript with Deeplearn.js by Houshalter on Tuesday December 05, 2017 @05:33PM (#15856679)
It's super sad to me, that the only convenient cross platform way to do deep learning is a hack on top of JS.
Re:Neural Networks in JavaScript with Deeplearn.js by connorelsea on Tuesday December 05, 2017 @05:36PM (#15856710)
Not sad - this is the beauty of modern JS.
Re:Neural Networks in JavaScript with Deeplearn.js by nsthorat on Tuesday December 05, 2017 @05:38PM (#15856731)
This is just the beginning :)
Re:Neural Networks in JavaScript with Deeplearn.js by rwieruch on Tuesday December 05, 2017 @05:48PM (#15856811)
<3
Re:Neural Networks in JavaScript with Deeplearn.js by j2kun on Tuesday December 05, 2017 @06:52PM (#15857329)
Folks 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!

Re:Neural Networks in JavaScript with Deeplearn.js by banachtarski on Tuesday December 05, 2017 @08:02PM (#15857682)
Why 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.

Re:Neural Networks in JavaScript with Deeplearn.js by paxy on Tuesday December 05, 2017 @08:19PM (#15857750)
What are we pretending here? A GPU is designed to do multiplication. We're doing multiplication. Calling it "texture" or "shading" or whatever else is only because of the GPU's root in gaming, otherwise the problems are exactly the same.
Re:Neural Networks in JavaScript with Deeplearn.js by Houshalter on Tuesday December 05, 2017 @07:39PM (#15857574)
Yeah 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.
Re:Neural Networks in JavaScript with Deeplearn.js by lettergram on Tuesday December 05, 2017 @11:59PM (#15858657)
pip 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.

Re:Neural Networks in JavaScript with Deeplearn.js by Houshalter on Wednesday December 06, 2017 @01:13AM (#15858957)
I 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-microsof... And as you mention, only Nvidia.
Re:Neural Networks in JavaScript with Deeplearn.js by Rapzid on Wednesday December 06, 2017 @02:51AM (#15859324)
Cuda 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.
Re:Neural Networks in JavaScript with Deeplearn.js by jorgemf on Tuesday December 05, 2017 @05:59PM (#15856906)
When 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.

Re:Neural Networks in JavaScript with Deeplearn.js by nsthorat on Tuesday December 05, 2017 @11:31PM (#15858525)
Or you improve your algorithms and use the existing hardware (think distributed computing on cheap HDDs).
Re:Neural Networks in JavaScript with Deeplearn.js by jorgemf on Wednesday December 06, 2017 @05:05AM (#15859913)
Companies 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.
Re:Neural Networks in JavaScript with Deeplearn.js by mr_toad on Tuesday December 05, 2017 @09:42PM (#15858084)
I'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.

Re:Neural Networks in JavaScript with Deeplearn.js by Houshalter on Tuesday December 05, 2017 @10:48PM (#15858308)
Presumably 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.
Re:Neural Networks in JavaScript with Deeplearn.js by mr_toad on Tuesday December 05, 2017 @11:22PM (#15858471)
Deeplearn.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.

Re:Neural Networks in JavaScript with Deeplearn.js by nsthorat on Tuesday December 05, 2017 @11:30PM (#15858518)
It doesn't work in node yet, a relevant issue: https://github.com/PAIR-code/deeplearnjs/issues/234
Re:Neural Networks in JavaScript with Deeplearn.js by state_less on Tuesday December 05, 2017 @05:56PM (#15856879)
I'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.

Re:Neural Networks in JavaScript with Deeplearn.js by state_less on Tuesday December 05, 2017 @06:00PM (#15856913)
I guess I'll have to keep waiting, this isn't using compute shaders apparently.
Re:Neural Networks in JavaScript with Deeplearn.js by nsthorat on Tuesday December 05, 2017 @11:30PM (#15858519)
Why wait?
Re:Neural Networks in JavaScript with Deeplearn.js by state_less on Wednesday December 06, 2017 @09:10AM (#15861125)
I 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.