convnetjs icon indicating copy to clipboard operation
convnetjs copied to clipboard

[Question] Why use javascript ?

Open howardyclo opened this issue 9 years ago • 14 comments
trafficstars

Hello, I'm a new comer to deep learning. And I'm just curious about why you use javascript to implement convnet that need expensive computation ? Why not just use python, or c++ ? Is there any specific reason ?

howardyclo avatar Sep 19 '16 17:09 howardyclo

I believe this was just meant as a demo, it's not a framework to be used for production applications. The datasets are modest and the use of JavaScript makes it more simple to do the beautiful presentations without a lot dependencies and glue code complicating everything.

davidparks21 avatar Sep 19 '16 19:09 davidparks21

I think that JavaScript is perfectly fine for AI and in some cases there is no other option, such as running in a web browser or a (hybrid) mobile APP .

Performance-wise there is no reason to believe that JavaScript would perform significantly slower than Python. The reason why Python is used over C++ is not performance, it is the ecosystem.

For fast execution Python or C++ might not even be the best for neural networks as GPGPU computing could be the ultimate solution for fast parallel computing of lots of artificial neurons. In that case JavaScript would yield roughly the same performances as Python of C++.

Because it is about the ecosystem it is important to build one, this is what's missing for JavaScript, not fast computation as so far the cleat winner would be Python.

uiteoi avatar Sep 21 '16 17:09 uiteoi

JS is the best solution and everyone should go for it. It is faster then everything else because it is distributed. It is not necessary the main idea of this framework, although, should be. Consider using only 10% of computer power on every visitor of a popular website and you can easily get hundreds/thousands computing hours a day. The best part, you get it for free.

MariasStory avatar Oct 01 '16 17:10 MariasStory

Personally, I think Javascript is not exactly a good idea, despite my own interest in this. Some of the bigger deep networks are too big to fit into the browser. For example, VGG 19 layers, which is around 500MB+, something that size would be difficult to handle in browsers.

If you're looking to seriously train and play with deep learning, I'd suggest going with Caffe. Also, for beginners, Caffe is a lot friendly (more tutorials and various places to ask.)

ghost avatar Oct 28 '16 15:10 ghost

there is port for c# https://github.com/cbovar/ConvNetSharp and behold it isn't worthless piece of garbage, it actually compiles! I guess you can convert it to c++ for turbo needs.

radioman avatar Nov 15 '16 22:11 radioman

@YuChunLOL convnetjs is an excellent library for in-browser visualizations / interactive demos. However, given numerical performance of V8 (JavaScript) and derivates, it is far from being optimal for production use (read it number crunching and analysis). As @uiteoi suggested you might want to have a look on TensorFlow or Caffe.

@MariasStory

JS is the best solution and everyone should go for it. It is faster then everything else because it is distributed.

It seems you got confused here; a bit.

ktamiola avatar Nov 16 '16 10:11 ktamiola

FYI those interested in a performant, modern browser-oriented implementation of neural nets should keep an eye on TensorFire, which uses WebGL and aims to be compatible with existing TensorFlow models.

damienstanton avatar Aug 24 '17 02:08 damienstanton

Has anyone actually been able to use Tensorfire? I put my email on their list weeks ago but haven't heard from them. I can't find the github repo to be able to use it the library.

jefffriesen avatar Aug 24 '17 03:08 jefffriesen

No, they have not released the source yet. Just demos. This is why I said it is worth keeping an eye on 😃

damienstanton avatar Aug 24 '17 23:08 damienstanton

Tok Uni did some perfect work base on javascript: https://github.com/mil-tokyo

yuu2lee4 avatar Dec 11 '17 12:12 yuu2lee4

As an update to my earlier comments, I also recommend https://deeplearnjs.org/

Hardware-acceleration and integration with existing TensorFlow models make this one particularly nice.

damienstanton avatar Dec 11 '17 15:12 damienstanton

A new framework http://propelml.org

yuu2lee4 avatar Feb 25 '18 06:02 yuu2lee4

tensorflowJS https://js.tensorflow.org/

yuu2lee4 avatar Apr 01 '18 07:04 yuu2lee4

I made the library UNN.js, which can do the same things ConvNetJS does, but 4x faster :) (still in a single Javascript thread)

https://github.com/photopea/UNN.js

photopea avatar Jan 09 '20 01:01 photopea