
Propel – Machine learning for Javascript - namanyayg
http://propelml.org/
======
rwieruch
That's totally exciting! Thanks to the author for enriching the ML ecosystem
in JavaScript :)

I didn't explore the full API yet, but already seeing the plotting
functionality for functions is a tremendous win for ML in JavaScript.

In case anyone is interested in doing ML in JS in 2018, there exists a larger
article which I wrote a couple of weeks ago that tries to convey the state of
the art of Machine Learning in JavaScript. [0]

\- [0] [https://www.robinwieruch.de/machine-learning-javascript-
web-...](https://www.robinwieruch.de/machine-learning-javascript-web-
developers/)

~~~
tail-recursion
If I had heard someone talking about ML in Javascript a few years ago I would
think it was a joke, probably because my professors seem to love to make fun
of javascript, PHP.

~~~
Can_Not
[https://github.com/php-ai/php-ml](https://github.com/php-ai/php-ml)

------
dustinmoorenet
It binds directly to the TensorFlow C API, if you run it in NodeJS, which is
awesome. I get tired of having to setup a python env anytime I want to play
around with ML.

~~~
Phrodo_00
So now you'll have to setup a nodeJS env? I don't really see the difference.

~~~
sgslo
Setting up a node env is arguably easier. An installer from the NodeJS
downloads page includes both the Node runtime and NPM. One executable to get
started.

Python, on the other hand, requires a python installer, then a pip or conda
installation script. Not to mention python vs python3 decisions.

~~~
cjalmeida
There's no python vs python3 decision to make. There's no (sane) reason to
pick Python 2 in 2018 for new projects.

Conda installer comes with Python prepackaged. So it's really a single exe and
one CMD to get a Tensorflow env setup. And, of course, you have access to
numpy, pandas, jupyter, PIL ...

~~~
jopsen
\+ virtualenv

I always forget to set that up. Also I never learned python packaging, with
npm it was trivial.

~~~
woolvalley
The basic rule of thumb is npm is 'virtualenv by default' while pip is 'global
by default'.

~~~
JBReefer
This kind of thing is why people are saying npm is easier...

~~~
3131s
Yes, npm installs libraries locally so it avoids the need for something like
virtualenv in the first place. Coming from Python, that immediately struck me
as a better approach to package management.

------
zengid
Looks like Mr Dahl was among the inaugural class of the Google Brain
Residency:

[http://tinyclouds.org/residency/](http://tinyclouds.org/residency/)

------
batmansmk
Going back to the Tensorflow C API and adding plotting + networking + async
capability is a smart engineering choice.

Will this project expand faster than Tensorflow Python to make it worth
investing in? We will see in the coming months :)

~~~
cjalmeida
Python has a larger ecosystem for data intensive application and pratictoners.
As a language it's very easy to learn for JavaScript devs.

The only "killer" feature JS may bring to the table would be client side,
browser based inference that leverages GPU. But we're eons away from that.

~~~
TAForObvReasons
Arguably the only "killer" feature Python has is the ecosystem. There are
efforts to build out a similar ecosystem for JS. For example
[https://github.com/jacobbogers/libRmath.js](https://github.com/jacobbogers/libRmath.js)
is a typescript port of R's core math library
[https://svn.r-project.org/R/trunk/src/nmath/](https://svn.r-project.org/R/trunk/src/nmath/)

~~~
kahnjw
And the full force of the entire machine learning research community (except
for a few still on Lua/Torch).

~~~
kapv89
We JS folks just need 1 good deep-learning system in JS. I really want that
system to be propel as it leverages the work that has gone in on tensorflow.
Let that piece fall into place, and just watch as the last bastion of python
gets overrun.

~~~
kahnjw
>>...watch as the last bastion of python gets overrun

That is a naive point of view. The python community has been growing for
decades [1]. Even if it is not growing as fast as javascript community, the
growth is sustainable, and probably won't slow until the companies that rely
on it for core parts of their infrastructure are gone (that could be 5
decades). Google, youtube, instagram, and countless other enormous
corporations with trillions of dollars in combined market cap are dependent on
it. Python isn't going anywhere.

[1]
[https://trends.google.com/trends/explore?date=today%205-y&q=...](https://trends.google.com/trends/explore?date=today%205-y&q=python3,nodejs)

------
zawerf
I was going to say that this seems like the same as deeplearn.js[0], but it
turns out this is built on top of it.

So I guess the real feature is cross-platform compatibility between node and
browser?

[0] [https://github.com/PAIR-code/deeplearnjs](https://github.com/PAIR-
code/deeplearnjs)

------
anonyfox
Didn’t he left the nodejs ecosystem because he said vocally that Go is so much
better? Just curious what changed his mind...

~~~
zengid
He just hates almost all software anyway:

[http://tinyclouds.org/rant.html](http://tinyclouds.org/rant.html)

------
flaque
[https://blog.codinghorror.com/the-principle-of-least-
power/](https://blog.codinghorror.com/the-principle-of-least-power/)

------
angel_j
this project does not work out of the box via npm install. seems like you have
to get all babel.js with it and maybe use a typescript executor like ts-node

ES2015 imports took javascript back to 2008, before node and npm made it
awesome.

use NPM and require if you are building tools for other people, that way they
can implement your work without adding compilers and obscure configurations to
their build. don't nobody want to use be forced to use alternative and
backwards incompatible technology

use typescript and import for "business logic"

~~~
piscisaureus
Although propel itself is written in typescript, supporting users that want to
write javascript is an explicit design goal. The npm package contains
"vanilla" javascript that targets node.js 8.x and later.

------
tekkk
This could a fun way to learn ML using just your browser. I'm still skeptic
about the performance but for prototyping it could be viable.

One thing bothering me about reading the API is the inconsistent way of adding
semicolons. Not an important thing I'm sure and as my personal opinion I'd
much rather have the examples without them. To me they are just waste of time.
Also it makes the code look more like Python.

Anyway, looks great!

~~~
irrational
You will hate to hear that there is a serious proposal to make semicolons
mandatory in the next version of ECMAScript.

~~~
seniorsassycat
I found [this pull request] that adds language recommending the use of
semicolons, but no proposals to require semicolons or to remove Automatic
Semicolon Insertion.

Removing ASI from ECMAScript would break backwards compatibility - modern JS
engines couldn't run scripts that use ASI which would break a lot of websites
that are alread deployed. ECMA will add features that won't run in old engines
(older V8 can't parse arrow functions) but they won't add/remove/change
features that break existing behavior.

Today there are code patterns where ASI is ambiguous, or at-least hard for a
developer to grok. TC39 is warning developers that new language features will
not be designed for ASI and might have confusing behavior if those new
features are used without semicolons.

[this pull request]:
[https://github.com/tc39/ecma262/pull/1062/files](https://github.com/tc39/ecma262/pull/1062/files)

------
randomerr
Is there a practical use case for this system? It looks great. I want to parse
out textual data and this system seems to only work on numbers sets.

~~~
metakermit
I guess it's still work in progress, but they are probably aiming to achieve
something in the direction of the scientific Python stack (i.e. Jupyter,
TensorFlow and the like). Maybe starting with a subset of methods useful in
ML.

It will be interesting to see how this scientific JS toolchain evolves. Would
be fun to get a more feature-complete Propel ML working with Mike Bostock's
Observable project:

[https://beta.observablehq.com/](https://beta.observablehq.com/)

~~~
anonytrary
> achieve something in the direction of the scientific Python stack (i.e.
> Jupyter, TensorFlow and the like).

Seems to be quite far away. IIRC, there are a lot of immature, scattered math
libs for JS.

Most of the ML libs I've seen are proof-of-concept, like brain.js or synapse.
Those libs seem to implement basic perceptrons and other textbook examples,
but not much else.

------
metakermit
Wonder if JS notebook environments like this one, Observable and runkit.com
will eventually all consolidate and (hopefully) integrate with Jupyter
Notebook / Lab

[https://jupyter.org/](https://jupyter.org/)

------
lunchladydoris
I enjoy machine learning and I'm interested in learning Javascript, so this
seems really interesting. That said, what would be a good way to build some
Javascript experience that would be useful for something like this?

------
herve76
We need more projects like this to bring better AI to JS. Thanks.

------
olfactory
Is anyone aware of a GAN example using propel or deeplearn.js ?

