'Tensorflow Core or js ? Discuss about pros and cons architecture
So, we want to build an application for some machine learning stuff and we are having trouble to define which of the API we should choose so I would be very happy if we could discuss the pros and cons of each choice. The thing is we are quite open minded about the application architecture but we do have some preferences.
First of all, as I understood from my readings, Tensorflow Core is for local application like desktop application and will use the CPU or GPU of the machine that runs it. Is it correct ? While Tensorflow js allows us to do ML tasks in the browser directly by using the ressources of the machine. OR we can use the server ressources to do the calculations (with node backend) and then it is displayed in the browser. Is it correct ?
Other questions that come to my mind :
- Is the Core API on local much faster than the js API doing calculations on server side with Node backend ?
- I saw that the Core API can use C++, is it native as python ? Because it would be one of our preferences : the team is used to C++ but not realy to python or javascript.
- Is it ok to do a client/server and make the server uses Core API for calculation ? Instead of going for the js API ? Again, it is by commodity. We are used to do application with a server and different client so everything could be in C++ using the Core API ? It would also be nice because in that case we can implement a client/server local for now and if the need come to go online, it would not change much.
- An other possibility would be to buy access to a high performance computing cloud simulation so we use the Core API on their server and we have a simple interface on our side i suppose ?
Feel free to do proposition and correct me. I am completly new to all this so it is basicaly all ideas and guess.
Thanks you for your help, best regards.
Solution 1:[1]
Is the Core API on local much faster than the js API doing calculations on server side with Node backend ?
tfjs-node is a wrapper around tensorflow.so library which comes from tf core. so the only performance difference would be which wrapper (node or python) has less overhead to pass values back and forth and that is minimal
but do note that python wrapper is much more complete than tfjs-node wrapper
I saw that the Core API can use C++, is it native as python ? Because it would be one of our preferences : the team is used to C++ but not realy to python or javascript.
in all case tf core is a shared library, the question makes no sense
Is it ok to do a client/server and make the server uses Core API for calculation ? Instead of going for the js API ? Again, it is by commodity.
sure. but then you need to do your own serialization of inputs and outputs to and from python. and have some persistence for the python process as you don't want to start it again and again for each api request.
An other possibility would be to buy access to a high performance computing cloud simulation so we use the Core API on their server and we have a simple interface on our side i suppose
this is pretty much the same as above. again, you do need to have some instance management and persistence
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vladimir Mandic |
