News for hackers. Stuff that matters.
Re:Neural networks in JavaScript – free 19-part course by decafbad on Sunday December 23, 2018 @11:44AM (#18747007)
Why the heck Javascript?
Re:Neural networks in JavaScript – free 19-part course by zawerf on Sunday December 23, 2018 @12:44PM (#18747300)
One very practical reason is to save on computation costs. GPU servers are not cheap and if you're going to run on CPU anyway, you might as well run it locally on the user's browser.

Some demos such as real time object detection isn't possible at all if you had to pay roundtrip server latency (not to mention the complexity of streaming video to and from your server): https://github.com/ModelDepot/tfjs-yolo-tiny

And a lot of web demos such https://affinelayer.com/pixsrv/ I don't believe will be up for such a long time if the author had to pay ongoing server costs.

Re:Neural networks in JavaScript – free 19-part course by karmasimida on Sunday December 23, 2018 @01:48PM (#18747628)
There is NO save on computation cost. CPU is slow for NN whatever language you are using.

OP has a point, if I want to learn PRACTICAL front end programming, I will choose javascript, not Python. Same for Neural networks, just switch the place.

Re:Neural networks in JavaScript – free 19-part course by zawerf on Sunday December 23, 2018 @02:52PM (#18747949)
Cost as in money.

To deploy a model in js (as a web page) all you need is a static S3 or GCS bucket. You don't even need a webserver and it can automatically handle infinite scale. Show me a python solution that can do the same.

Re:Neural networks in JavaScript – free 19-part course by yonkshi on Sunday December 23, 2018 @09:02PM (#18749770)
There is currently no NN learning algorithm that can handle massively paralleled training. We can use some simple fixes such as mean gradient but they have severe limitations, and their limitation grows as you scale up. Currently even with a handful paralleled GPU training, the gradient computation needs to wait for all GPU batch to complete and then return to CPU before the next batch, so your idea of infinite scaling is just a pipe dream at the moment. Sure Python can't be run on a million pages, but heck, no NN architecture can even handle more than a dozen paralleled computation in a stable manner yet.
Re:Neural networks in JavaScript – free 19-part course by zawerf on Monday December 24, 2018 @01:26AM (#18750753)
Yea the infinite scaling was referring to deployment of inference, not training.
Re:Neural networks in JavaScript – free 19-part course by karmasimida on Sunday December 23, 2018 @09:44PM (#18749918)
> To deploy a model in js (as a web page) all you need is a static S3 or GCS bucket.

First of all, what you have described is far from the reality.

Had this come true, only inference will be in javascript, through some language agnostic standardized model format, not training. The model is just a blackbox function for the js runtime to call. The amount of javascript to make this happen will be surprisingly slim anyway.

Re:Neural networks in JavaScript – free 19-part course by zawerf on Monday December 24, 2018 @01:25AM (#18750746)
> First of all, what you have described is far from the reality.

Did you try any of the links I included? This is the reality for all of them and they are a few years old. They have a model file loaded from bucket url and never make another network request thereafter.

It's actually the recommended workflow from https://js.tensorflow.org/ where you'd find tons of other examples.

But you're right, this is for inference only. I would not do training in JS.

Re:Neural networks in JavaScript – free 19-part course by karmasimida on Monday December 24, 2018 @07:23PM (#18755065)
What I mean reality here is the running nn model in browser is possible, but not practically efficient, so even with its perceived simplicity, people would under most occasions, run the inference in the cloud, with its controllability and performance, like using customized hardware. After all, running inference is about to run it reliably and fast, until the day when nn operations are ubiquitous and common enough to be standardized and shipped in performant runtime that come out-of-box, browser inference is still a dream that is too good to be true.
Re:Neural networks in JavaScript – free 19-part course by mschuetz on Sunday December 23, 2018 @02:02PM (#18747707)
What's wrong with js for neural networks? JS/V8 is faster than python, not accounting for python bindings to native NN libs that may as well be bound to js.
Re:Neural networks in JavaScript – free 19-part course by yonkshi on Sunday December 23, 2018 @03:11PM (#18748052)
JS/V8 may beat Python in general operations but definitely not in math specialized libraries. A lot of python packages support OpenBLAS and AVX/FMA by default which gives huge boosts to math/tensor operations. Correct me if I'm wrong, I don't think the js ecosystem is quite there yet except for experimental projects.
Re:Neural networks in JavaScript – free 19-part course by karmasimida on Sunday December 23, 2018 @02:14PM (#18747764)
There is nothing wrong to use js, like there is nothing wrong to call it impractical.

JS is faster than Python, but in the land of DL, there is C++ and everyone else. No one is using Python to do the actual computation anyway.

Re:Neural networks in JavaScript – free 19-part course by zamadatix on Sunday December 23, 2018 @02:53PM (#18747953)
"No one is using Python to do the actual computation anyway."

Depends what "actual" computation is. If you're definition of "actual computation" is something which requires extreme optimization then your definition precludes the question. In the real world there is an extraordinary amount of computation done with inefficient languages though simply because development time costs very often outweighs run time costs.

Re:Neural networks in JavaScript – free 19-part course by heavyset_go on Sunday December 23, 2018 @11:12PM (#18750274)
Python is used because there are C/C++ bindings for working with NNs.

The point is that none of computations are done in pure Python. Python just provides a convenient wrapper over non-Python code.

Re:Neural networks in JavaScript – free 19-part course by yonkshi on Sunday December 23, 2018 @09:11PM (#18749798)
Are you suggesting distributed NN training through user's browsers? This is a very sketchy area along the lines of browser based bitcoin mining. You don't want to run any computation heavy code on client side without user's knowledge & approval.

Though if you only meant performing inference in user's browsers, then the challenge would be to find a way for TF/pytorch pre-trained models to port and perform accurately in js. If successfully done, I can see some use cases here.

Re:Neural networks in JavaScript – free 19-part course by zawerf on Monday December 24, 2018 @01:28AM (#18750764)
See https://js.tensorflow.org/ for automatically porting tensorflow models to the browser
Re:Neural networks in JavaScript – free 19-part course by dahfizz on Sunday December 23, 2018 @01:31PM (#18747528)
Are you under the impression that js is the only language that can run locally?
Re:Neural networks in JavaScript – free 19-part course by itslennysfault on Sunday December 23, 2018 @05:36PM (#18748824)
in a client's web browser... yeah.
Re:Neural networks in JavaScript – free 19-part course by dahfizz on Sunday December 23, 2018 @10:05PM (#18749999)
Well there is web assembly, but why is running in a web browser a requirement for creating a neural network anyway?
Re:Neural networks in JavaScript – free 19-part course by kkarakk on Monday December 24, 2018 @08:10AM (#18751960)
so you can offset server costs to the client which usually means bloated laggy apps until someone comes along and figures out an optimised way of doing things, for eg react.js vs phonegap's comparative shitshow
Re:Neural networks in JavaScript – free 19-part course by mattlondon on Monday December 24, 2018 @05:46AM (#18751528)
Personally I've found that Python - or perhaps more Numpy et al - are impenetrable for a learner. I am sure the data structures that are used in Python + Numpy et al are powerful and well-suited for the task, but as a learner coming to this with minimal knowledge trying to ALSO learn the idiosyncrasies and weirdness (IMHO) of how Numpy does things and the weirdness (IMHO) of how Numpy even names things (e.g. in decades of programming, the term "shape" for an array was new on me) was an extra burden.

Doing the same thing in Javascript with good old-fashioned arrays using good old-fashioned terminology clears the fog and makes things simpler for people who are not already fluent in numpy's data structures and terminology

Javascript is - in my view - the equivalent of a "business english" of programming, i.e. even if you aren't fluent, its syntax and terminology is familiar to C/C++/Java/C#/Golang/ObjectiveC/Perl/etc that most people will at least be able to understand what is going on in the same way that business people who might not be fluent in English will at least be able to understand and basically communicate with each other even if they perhaps will not be writing Sonnets. Python feels like a niche language that developed in isolation and is only readable to people who have actually gone out of their way to learn it.

Re:Neural networks in JavaScript – free 19-part course by kkarakk on Monday December 24, 2018 @08:05AM (#18751945)
shape makes sense if you think of arrays in terms of linear algebra concepts(which you should if you're working with ML concepts imo)
Re:Neural networks in JavaScript – free 19-part course by mathgeek on Sunday December 23, 2018 @12:08PM (#18747112)
Why not? It's one of the most widely known languages among developers in many disciplines, which removes a barrier to learning the concepts. Someone who just wants to familiarize themselves with basic implementations could do so in any language if their goal doesn't include shipping production-quality code. There's also the added bonus that the concepts taught here are already covered by courses in other languages, so anyone is free to use those as well.
Re:Neural networks in JavaScript – free 19-part course by SquareWheel on Sunday December 23, 2018 @12:13PM (#18747129)
Why not? It's extremely popular, fast and portable.
Re:Neural networks in JavaScript – free 19-part course by hombre_fatal on Sunday December 23, 2018 @03:09PM (#18748034)
Also, it's hard to beat the browser for creating a quick visualization/UI for your code. Especially for an online course like this.

I think we're at a point where you'd have to justify why you didn't use Javascript for a learning course.

Re:Neural networks in JavaScript – free 19-part course by reiinakano on Sunday December 23, 2018 @02:30PM (#18747836)
Re:Neural networks in JavaScript – free 19-part course by axel180 on Sunday December 23, 2018 @02:14PM (#18747771)
Usage: Javascript is everywhere and can be learned quickly. Speed: GPU can easily be tapped into inside Javascript with projects like GPU.js, which brain.js uses.
Re:Neural networks in JavaScript – free 19-part course by ilrwbwrkhv on Sunday December 23, 2018 @11:46AM (#18747013)
coz its the best language for prototyping and learning
Re:Neural networks in JavaScript – free 19-part course by king_magic on Sunday December 23, 2018 @12:09PM (#18747114)
It really, really super isn’t. It’s a Frankenstein mashup of programming insanity that never should have come into being in the first place, much less become the de facto language of the web.
Re:Neural networks in JavaScript – free 19-part course by ilrwbwrkhv on Sunday December 23, 2018 @12:28PM (#18747205)
it actually isnt a mashup... if u look at the data types... they are some of the simplest... the apis might be a bit weird... i agree
Re:Neural networks in JavaScript – free 19-part course by kukabynd on Monday December 24, 2018 @11:21AM (#18752787)
So, what language is not an insanity?
Re:Neural networks in JavaScript – free 19-part course by colordrops on Sunday December 23, 2018 @12:20PM (#18747156)
Any particular reasons or is this just based on what you heard 10 years ago?
Re:Neural networks in JavaScript – free 19-part course by aaaaaaaaaab on Sunday December 23, 2018 @01:20PM (#18747481)
From the top of my head:

- `this`

- the whole prototypal inheritance thing

- class inheritance bolted on top of prototypal inheritance

- arrow functions vs `function` functions

Re:Neural networks in JavaScript – free 19-part course by cwackerfuss on Sunday December 23, 2018 @02:20PM (#18747797)
But none of that is going to affect our ability to do machine learning work with JavaScript
Re:Neural networks in JavaScript – free 19-part course by kkarakk on Monday December 24, 2018 @08:11AM (#18751965)
doesn't it affect complexity on an exponential scale though? codebases aren't paragons of perfection when even 2 devs are working on them
Re:Neural networks in JavaScript – free 19-part course by supakeen on Sunday December 23, 2018 @12:06PM (#18747103)
There are many languages that are very popular for prototyping and learning what makes JavaScript the best?
Re:Neural networks in JavaScript – free 19-part course by ilrwbwrkhv on Sunday December 23, 2018 @12:31PM (#18747227)
also for better or for worse... the javascript ecosystem is amazingly wide... from brain as in this example to p5js for creative programming etc... i think we can agree that no other language and ecosystem has that much breadth and reach...
Re:Neural networks in JavaScript – free 19-part course by ilrwbwrkhv on Sunday December 23, 2018 @12:27PM (#18747200)
for one its available in any browser console... there is no setup per se.