Live data from Hacker News

Brain.js

github.com

21–30 of 56 posts

Re: Brain.js

#21

Earlier quoted context omitted.

I share the concern about mono-cultures in tech, but if you are serious about getting into data science or AI I have to agree with the OP -- stick to TensorFlow. TensorFlow.js is not a first class citizen of that ecosystem, but its close enough to get real work done. Also... there are some groups that use Javascript for this kind of work (We use Typescript for our projects), but the vast majority of it is in Python.…

> if you are serious about getting into data science or AI Then you won't be using Javascript anyways. Like you said, Python is the way to go: PyTorch, TF, PyMC3, scikit-learn, etc.

There are several firms that I personally know of that use alternative languages for building production systems around AI. My two largest clients have systems built in Typescript and Java. If you are going to work in this field you have to know Python as it is a common language for practitioners, but the language choice for production systems is driven by many factors. Python is almost never an appropriate choice for building production systems. Even in cases where we use Python for models, the models are exported to a different language for integration with the deployed application. In many cases there are substantial benefits to building models in the language that will used for building the final application as well. As with all technical choices, the needs of the project should be the ultimate basis for making a selection -- not fanboi attachments to particular languages.

Re: Brain.js

#22

A 19-part interactive neural network course that uses brain.js was posted to HN last week: https://scrimba.com/g/gneuralnetworks

For reference, NodeJS support for GPUs will only drop under version 2, so if you're planning on GPU acceleration, this is not for you.

This is Robert, the lead developer for brain.js. Ty for the plug! I was going to mention this, nice to see people listening and helping spread the word. Working on it hard guys! When spare time cannot be had, just stay up late, and get up early!

Re: Brain.js

#23
post #6

Earlier quoted context omitted.

Even as someone who has only superficial knowledge of the topic, that course was very underwhelming.

As someone with absolutely no knowledge of the topic, I found that course to be very digestible and pleasant.

Ty, I hope my voice is/was not very irritating. I obsess over relaying ideas in a _very simple_ manner.

Things should be as simple as possible, but not simpler...

Re: Brain.js

#24
post #17

Earlier quoted context omitted.

I followed the progress back then and felt very bad for both, that such an awesome library was going down and the bad situation she found herself into. Hope she is doing well! And happy to see brain being reborn.

What happened to the author? I'm not aware of the history...

What happened was essentially bullies. I think it is apparent now that the library and, more importantly, the idea of a data first neural network architecture in javascript isn't going away.

Re: Brain.js

#25

Earlier quoted context omitted.

As someone with absolutely no knowledge of the topic, I found that course to be very digestible and pleasant.

Same. It was so accessible (voiceover in an online code editor) that I just did it instead of bookmarking it for a day that never arrives.

That is really cool to hear!

Re: Brain.js

#26
post #6

A 19-part interactive neural network course that uses brain.js was posted to HN last week: https://scrimba.com/g/gneuralnetworks

Even as someone who has only superficial knowledge of the topic, that course was very underwhelming.

Ty for your thought. I'd love to know more specifics.

Re: Brain.js

#27
post #18

The sample app (the color contrast stuff) hurt my feelings a bit. I used to work on an app that needed to do something similar and I ended up fighting with the YIQ formula (it really doesn't work for a lot of cases). Playing with the sample just a bit and I ended up replicating what had taken me weeks to do back in the days...

This was good, correct? I'd love to hear what your use case was, like which colors didn't work, etc.

Re: Brain.js

#28
post #27
post #18

The sample app (the color contrast stuff) hurt my feelings a bit. I used to work on an app that needed to do something similar and I ended up fighting with the YIQ formula (it really doesn't work for a lot of cases). Playing with the sample just a bit and I ended up replicating what had taken me weeks to do back in the days...

This was good, correct? I'd love to hear what your use case was, like which colors didn't work, etc.

Haha, sorry if it was unclear, my tone was in jest.

Yeah, basically what Im trying to say is that this is awesome. It was several years ago so I don't have my old code anymore (different job), but it was in the printing industry, where we wanted to warn customers that their choices of color were...dubious.

However, it's extremely subjective. An example is certain shades of red/orange. The formula might tell you that using white text is a bad idea, but they're really the same to read, and white looks better.

One thing I'd have to play around more than my free time allows, but I had to deal with back then, was backgrounds with multiple color. Where it got really tricky is when the text overlaps multiple colors, you have to decide if you're seeing enough of the text that one foreground color is ok, or if it's too much and you have to say "no". It was incredibly tricky to do, especially with things like antialiasing involved. Training a model with that data probably would give much better results than my tweaked formulas of old.

Re: Brain.js

#29
post #15

y tho? https://js.tensorflow.org/

I'm aware of tensorflow.js, but what really struck me with brain.js was this snippet from the very beginning of the readme file: how to approximate the XOR function using brain.js const net = new brain.NeuralNetwork(config); net.train([{input: [0, 0], output: [0]}, {input: [0, 1], output: [1]}, {input: [1, 0], output: [1]}, {input: [1, 1], output: [0]}]); const output = net.run([1, 0]); // [0.987] This is how you win…

Great point.

This is why I used p2.js for javascript game physics over franken-emscripten Box2d ports.

The readme and source code are extremely accessible (https://github.com/schteppe/p2.js#sample-code).

When I was trying to optimize my collision detection, I stepped in to p2.js source to read narrowphase vs broadphase implementations. Last I used Box2d, I was reading c++ pdf documentation.

Re: Brain.js

#30

y tho? https://js.tensorflow.org/

1. Tensorflow.js closely (not exactly) mirrors the python counterpart, and its api's, and thinking. We feel it does not reflect node ideologies well. And not the shify, what is in today is out tomorrow, thinking. The thinking that is practical, and applies well to business tastics. Brain.js started in node, and was original in its way it tackled the problem. Being data first, easy api, and then speed. It just works. 2. The vast majority of machine learning needs are encompassed within the library, and are only getting better. 3. The library can be learned in a matter of hours rather than weeks or months. 4. We can do it faster, simpler, than tensorflow.js. GPU support is coming in NodeJS, but is already partially implemented for browser, with fallback to CPU. 5. Brain.js was measured, where its benchmark was even better than industry standards, including IBM's Watson: https://github.com/jesus-seijas-sp/demo-nlp (note: project uses brain.js). Tensorflow.js isn't mentioned in this link, but I talked with the author about using Tensorflow.js, which he did try for this exact project, and his exact reply was: "with tensorflow.js same implementation I got a 0.91, but taked more time to train with CPU" (complete with typo) 6. Any corporation as powerful as those who maintain tensorflow should not have all the say in something as powerful as machine learning. Everyone should, and can. 7. We choose to.
Post reply on HN