| There's literally only one reason to do it in Javascript: you want to use Javascript. There are dozens of reasons why it's a terrible idea: unfortunate memory consumption, abysmal performance, poor abstractions, bad library support, and so on. Tensorflow in Python isn't exactly a stellar choice for performance, but at least you gain flexibility and nice abstractions and good high-performance math/stats library support. Go with JS, and you're getting none of that. "Many companies and projects have their entire server-side stack in JavaScript and Node.js, and often they want to simply make a prediction through a model." Right. So this is "we don't want to use another language". Acknowledged. "Privacy. You can make predictions locally, or send embeddings back to a server without the raw data ever leaving a client." If calling out to a binary is a security problem for you, you have bigger problems than choice of language. Also, of course, you don't need tensorflow to convert your top-secret data into an input vector that you can send somewhere (seriously: it does not help with this problem). Your third and fourth points -- flexibility and interactivity -- are indeed why people use Python vs C++ (even though it's more difficult and painful to get decent performance out of TF with that approach). So again, this boils down to "I don't want to use Python and I'd prefer to use JS instead." "No servers for applications. Making predictions in TensorFlow on a server can be expensive in the long run. Hosting static weights on a server is much much cheaper." You're contradicting yourself with this point. Servers are expensive so hosting static weights on a server is cheaper? I have no idea what this means. |
Yup, which is a perfectly valid reason.
> If calling out to a binary is a security problem for you
You miss the point. The security problem is sending the raw data from the client to the server.
> So again, this boils down to "I don't want to use Python and I'd prefer to use JS instead."
Which once again, is a perfectly valid reason
> Servers are expensive so hosting static weights on a server is cheaper?
No, CPU/GPU intensive tasks on a server is expensive but storing a few static weights is cheap.