Machine Learning : Tensorflow v/s Tensorflow.js v/s Brain.js [closed]

早过忘川 提交于 2020-06-24 08:02:24

问题


I've recently started coding with Machine learning techniques and had been going back and forth between Machine learning implemented in different platforms. The frameworks i worked a lot with were Tensorflow (Python), Tensorflow.js and Brain.js. And i've got couple of doubts about them.

  1. Why do most of them prefer Tensorflow (Python) over Tensorflow.js. What does Tensorflow has that Tensorflow.js doesn't which makes it special?
  2. Most people i've seen in the internet prefer working with Tensorflow.js than brain.js, even though brain.js uses JSON objects which doesnt put the developer in a hassle to create Tensors and make memory management and stuff. Why do people prefer working with Tensorflow.js even though brain.js is easy to implement?
  3. If i'm making a web site which uses Node.js as a backend, which would be the preferable library to be implemented for Machine Learning in a long run? Tensorflow.js or Brain.js? or should i use Tensorflow separately for just Machine learning things?

I've been searching a lot on these topics. And i haven't got a nice explanation for my doubts yet. So expecting a clear and detail exaplanation :)


回答1:


The speeds are different: Tensorflow > tfjs > brainjs. Python can be directly compiled to machine code and directly use the CPU and GPU, whereas tfjs is a script-language which is being compiled on the client and has to use the <canvas> in the browser to access the GPU the same as brain.js (I am not sure if brain.js is GPU-accelerated)

Another thing is that tensorflow is a whole ecosystem, which is kept in sync with each different version for the different platforms, so it is really easy to port your python(keras) model to tfjs and if you know how to code a tensorflow-model you can do it in any language.

And if you're using nodejs the only reason to stay with tfjs and not switch to python is that you like the JavaScript language better or you are forced to use because you are working in a JS backend.

PS: A new library was just released (ML5), which is a wrapper for tfjs and adds a lot of stuff, which helps you to build and use models without having a deep machine learning background.



来源:https://stackoverflow.com/questions/51797280/machine-learning-tensorflow-v-s-tensorflow-js-v-s-brain-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!