For anyone interested, here is a sampling of available ML libs in JavaScript. The first two, including tensorflow.js, are sub-libraries of the major ML projects, and the others are custom JS libs:
brain.js if I remember correctly is a very old project and is no longer maintained. But it was great to learn the basic ANN concepts. What I would love to see is a Node.js implementation of deep learning and ML libs (those listed above are targeted for browsers). With Node.js supporting most of es6+ features it's been a fun coding in it. Can't wait to get hands on ML with server side JavaScript as well..
I think my favorite part of this is that inevitably people will write type definitions for TensorFlow.js in TypeScript, Flow, ReasonML, Purescript, and more.
It has always seemed like data science and machine learning tasks have always been most popular in dynamic languages like Python, Julia, and R. I really hope this can be a bridge over to typed machine learning APIs!
(Of course, I’m also interested to hear about your favorite typed machine learning library if you have some that you already use)
Absolutely spot on... I love watching Siraj Raval's videos on ML - but darn it every other video has a 2 or 3 minute segment where he's just scratching his head - finally to realize there is a typo that could have been caught with a typed language!
I would love to see some full Tensor Flow bindings for Go. It's concurrency system is great for data science tasks. The statically linked binary makes it great for distributed workflows.
I think dynamic languages are a bad fit, because they force the programmer to think in data-flow graphs, whereas a more static language could allow for more offloading of complexity to a compiler (i.e. let the compiler build the data-flow graph, which is essentially what we've been doing for decades).
For folks who want to immediately play around with this — I've ported over the sentiment analysis example to an Observable notebook, so you can just edit the code directly:
Thanks for this! As a non-ML'er (for lack of a better term), I enjoyed seeing how simple it could be to port this kind of amazing stuff into a JS app :)
This is really cool. I was wondering what the difference between this and deeplearnjs[0] were, and turns out it's the same thing. Between this, and propelml[1] (from the creator of node.js), it seems like ML in the JS ecosystem is starting to pick up.
It'd be cool to see more demos like the ones on the https://tenso.rs/ website. Seems like they were using their own hand rolled library though.
There's also a high-level library built on top of tensorflow.js that makes it even easier to use some common ML methods: https://github.com/ml5js/ml5-library (disclosure: I'm part of the team developing it)
If you are interested in using production-grade ML from JS -- and the full data science and big data eco-system -- a bunch of us in the Apache Foundation and GPU world have been joining under Arrow and GOAI: https://devblogs.nvidia.com/goai-open-gpu-accelerated-data-a... .
The Graphistry team and ccri have been investing on zero-copy nodejs bindings to the full ecosystem, eg, leverage full TenserFlow, AWS GPUs, CuDNN, SciPy, pandas, dask, multigpu, MapD, etc. If you're a node hacker, this is an open effort -- contributors welcome! You can reach me at leo@[ graphistry], and I'll be publishing some JS roadmaps summarizing recent meetings and release directions.
"TensorFlow.js automatically supports WebGL, and will accelerate your code behind the scenes when a GPU is available."
imply that you can get all the benefits of GPU-accelerated machine learning on any old GPU---not just CUDA-compatible Nvidia GPUs?
For example, if you've got one of those 15 inch Macbook pros with a GPU, can you use TensorFlow.js to train a model at comparable (even if not identical) speed to a custom deep learning box?
Does the WebGL integration mean it doesn't require installation of CUDA or cuDNN on the machine it's running on? That's currently the most difficult part by far of getting GPU-enabled TensorFlow up and running in Python.
Additionally, can it work with non-NVIDIA GPUs? That is another fairly stringent current limitation for those that don't want to cough up the dough for an NVIDIA card or pay for cloud service.
One important reason is that it helps democratize ML to make it accessible to everybody. Even a casual hobby programmer can write awesome applications, and anybody - especially non-technical users - can use them. It makes ML - especially inference - as easy as opening facebook.
Right now, just to consume ML models - whether as a application developer or an end user - requires some combination of special skills that fall in a spectrum of complexities - from something relatively simple like installing a system package or an environment like Anaconda or a pip package, to something much more complex and time consuming like building TF or Caffe.
It's platform independent. Most deep learning libraries have absurd dependencies. They are difficult to install and only support specific OSes and GPUs. Javascript will run literally anywhere.
Think more from the inference angle. There are a lot of use cases for ML and many are using native apps or desktop apps. This allows you to run it on the browser on the web, which significantly broadens the amount of people who can use it.
So can you think of use cases for using ML in an app (native or desktop?) Many of those would be good to have in the browser as part of a web app too.
For everyone's reference, I had remembered there was already a library that existed that claimed to do this.
I was digging around to find it, it's called deeplearn.js, and upon checking it looks like that project has officially moved to the one referenced in this very post.
[+] [-] rationalthug|8 years ago|reply
[tensorflow.js](https://github.com/tensorflow/tfjs)
[mxnet.js](https://github.com/dmlc/mxnet.js/)
[propel.js](https://github.com/propelml/propel) - this uses tensorflow.js under the hood
[ml5](https://github.com/ml5js/ml5-library) - also uses tensorflow.js
[webdnn](https://github.com/mil-tokyo/webdnn)
[brain.js](https://github.com/BrainJS/brain.js)
[mljs](https://github.com/mljs/ml)
[synaptic](https://github.com/cazala/synaptic)
edit: added the ml5 lib mentioned in a subsequent comment.
[+] [-] singularity2001|8 years ago|reply
[+] [-] modeless|8 years ago|reply
[+] [-] Houshalter|8 years ago|reply
convnetjs https://cs.stanford.edu/people/karpathy/convnetjs/
I think the author of these also had one for reinforcement learning.
[+] [-] murukesh_s|8 years ago|reply
[+] [-] z1mm32m4n|8 years ago|reply
It has always seemed like data science and machine learning tasks have always been most popular in dynamic languages like Python, Julia, and R. I really hope this can be a bridge over to typed machine learning APIs!
(Of course, I’m also interested to hear about your favorite typed machine learning library if you have some that you already use)
[+] [-] wwwigham|8 years ago|reply
Actually, it already ships with typescript definitions - it's written in TypeScript![1]
[1] https://github.com/tensorflow/tfjs/blob/master/src/index.ts
[+] [-] coding123|8 years ago|reply
[+] [-] improbable22|8 years ago|reply
Flux is essentially nothing but some clever use of Julia's type system:
https://github.com/FluxML/Flux.jl
There's some ability to generate javascript too, which you can try here: http://fluxml.ai/experiments/mnist/ . Edit: I see it's actually using deeplearn.js == TensorFlow.js for this, details at https://github.com/FluxML/FluxJS.jl
[+] [-] narrator|8 years ago|reply
[+] [-] formalsystem|8 years ago|reply
I'm really looking forward to a superior dev experience with writing ML code once great autocompletion kicks in
[+] [-] colek42|8 years ago|reply
[+] [-] harveynick|8 years ago|reply
https://news.ycombinator.com/item?id=16719615
[+] [-] amelius|8 years ago|reply
[+] [-] mrkgnao|8 years ago|reply
https://github.com/tensorflow/haskell
[+] [-] jashkenas|8 years ago|reply
https://beta.observablehq.com/@jashkenas/sentiment-analysis-...
... or just have fun watching it analyze random Metacritic reviews of ”The Last Jedi”.
[+] [-] sarreph|8 years ago|reply
[+] [-] GoToRO|8 years ago|reply
"This is very good as in a very good cancer. It is as good as a dirt burger."
Positivity 0.9992088079452515
[+] [-] m0meni|8 years ago|reply
It'd be cool to see more demos like the ones on the https://tenso.rs/ website. Seems like they were using their own hand rolled library though.
[0]: https://deeplearnjs.org/ [1]: https://github.com/propelml/propel
[+] [-] 3laab|8 years ago|reply
There are already some cools demos built with tensorflow.js(https://deeplearnjs.org/demos/performance_rnn or https://teachablemachine.withgoogle.com)
There's also a high-level library built on top of tensorflow.js that makes it even easier to use some common ML methods: https://github.com/ml5js/ml5-library (disclosure: I'm part of the team developing it)
[+] [-] lmeyerov|8 years ago|reply
The Graphistry team and ccri have been investing on zero-copy nodejs bindings to the full ecosystem, eg, leverage full TenserFlow, AWS GPUs, CuDNN, SciPy, pandas, dask, multigpu, MapD, etc. If you're a node hacker, this is an open effort -- contributors welcome! You can reach me at leo@[ graphistry], and I'll be publishing some JS roadmaps summarizing recent meetings and release directions.
[+] [-] paultopia|8 years ago|reply
"TensorFlow.js automatically supports WebGL, and will accelerate your code behind the scenes when a GPU is available."
imply that you can get all the benefits of GPU-accelerated machine learning on any old GPU---not just CUDA-compatible Nvidia GPUs?
For example, if you've got one of those 15 inch Macbook pros with a GPU, can you use TensorFlow.js to train a model at comparable (even if not identical) speed to a custom deep learning box?
[+] [-] modeless|8 years ago|reply
[+] [-] rkp8000|8 years ago|reply
Does the WebGL integration mean it doesn't require installation of CUDA or cuDNN on the machine it's running on? That's currently the most difficult part by far of getting GPU-enabled TensorFlow up and running in Python.
Additionally, can it work with non-NVIDIA GPUs? That is another fairly stringent current limitation for those that don't want to cough up the dough for an NVIDIA card or pay for cloud service.
[+] [-] anonfunction|8 years ago|reply
[+] [-] diefunction|8 years ago|reply
[+] [-] lovelearning|8 years ago|reply
Right now, just to consume ML models - whether as a application developer or an end user - requires some combination of special skills that fall in a spectrum of complexities - from something relatively simple like installing a system package or an environment like Anaconda or a pip package, to something much more complex and time consuming like building TF or Caffe.
ML in browser bypasses all of that.
[+] [-] Houshalter|8 years ago|reply
[+] [-] shwetank|8 years ago|reply
So can you think of use cases for using ML in an app (native or desktop?) Many of those would be good to have in the browser as part of a web app too.
[+] [-] rytill|8 years ago|reply
[+] [-] ralusek|8 years ago|reply
I was digging around to find it, it's called deeplearn.js, and upon checking it looks like that project has officially moved to the one referenced in this very post.
https://deeplearnjs.org/
[+] [-] rwieruch|8 years ago|reply
- [0] https://www.robinwieruch.de/machine-learning-javascript-web-...
[+] [-] batmansmk|8 years ago|reply