5 ms·
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
by zawerf 8y ago
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 https://github.com/ModelDepot/tfjs-yolo-tiny
And a lot of web demos such https://affinelayer.com/pixsrv/ 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.
- dahfizz 8y agoAre you under the impression that js is the only language that can run locally?
- itslennysfault 8y agoin a client's web browser... yeah.
- dahfizz 8y agoWell there is web assembly, but why is running in a web browser a requirement for creating a neural network anyway?
- kkarakk 8y agoso 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
- karmasimida 8y agoThere 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.
- mschuetz 8y agoWhat'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.
- karmasimida 8y agoThere 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.
- zamadatix 8y ago"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.
- heavyset_go 8y agoPython 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.
- deleted 8y ago[deleted]
- yonkshi 8y agoJS/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.
- yonkshi 8y agoAre 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.
- zawerf 8y agoSee https://js.tensorflow.org/ https://js.tensorflow.org/ for automatically porting tensorflow models to the browser