Tensorflow.js – A Practical Guide
blog.yellowant.com
Tensorflow.js – A Practical Guide
1–10 of 37 posts
Re: Tensorflow.js – A Practical Guide
#2I think your step 4 code is messed up though?
Re: Tensorflow.js – A Practical Guide
#3Re: Tensorflow.js – A Practical Guide
#4Joking aside this is super cool
Re: Tensorflow.js – A Practical Guide
#5Noob question: Can anybody tell in a few sentences of plain english what is tensorflow, how it works and why seems to be so relevant?
HN people are mainly interested in it because it's one of the major frameworks for creating neural networks. Also because Google.
The framework is written in C++ but has decent bindings to Python, and is popular in both languages. Aside from wanting to use Javascript, there are no good technical reasons to do any of this stuff in Javascript.
Re: Tensorflow.js – A Practical Guide
#6Noob question: Can anybody tell in a few sentences of plain english what is tensorflow, how it works and why seems to be so relevant?
It's a high-performance-computing framework that allows you to specify matrix and vector math expressions in terms of a graph structure. In exchange, you get automatic derivative calculation, and a somewhat easier ability to distribute complicated calculations across processors. HN people are mainly interested in it because it's one of the major frameworks for creating neural networks. Also because Google. The framew…
Re: Tensorflow.js – A Practical Guide
#7Noob question: Can anybody tell in a few sentences of plain english what is tensorflow, how it works and why seems to be so relevant?
It's a high-performance-computing framework that allows you to specify matrix and vector math expressions in terms of a graph structure. In exchange, you get automatic derivative calculation, and a somewhat easier ability to distribute complicated calculations across processors. HN people are mainly interested in it because it's one of the major frameworks for creating neural networks. Also because Google. The framew…
- 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. It's quite a lot to ask them to pull in a python runtime just to make a prediction. TensorFlow.js with node bindings to TensorFlow C enables this type of inference with minimal overhead.
- Privacy. You can make predictions locally, or send embeddings back to a server without the raw data ever leaving a client.
- Flexibility of JavaScript / TypeScript. Dynamic languages are great for scientific computing, TypeScript allows you to define your own level of type safety, from raw JS on one end, to strict typing support on the other end.
- Interactivity / education tooling. See tensorflow playground for an excellent example.
- 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.
JavaScript and Python ecosystems for machine learning are not mutually exclusive -- they both have their strengths and weaknesses.
Re: Tensorflow.js – A Practical Guide
#8Noob question: Can anybody tell in a few sentences of plain english what is tensorflow, how it works and why seems to be so relevant?
For example, x can be tens of thousands of images of cats and dogs, and y can be 1 for a dog and 0 for a cat. The goal for the fitting algorithm is to find parameters that describe the concept of a cat and a dog so that it can can generalize and categorize general images of cats and dogs. A bad fit would be if the network just memorized the example images.
Re: Tensorflow.js – A Practical Guide
#9https://js.tensorflow.org/tutorials/import-keras.html
Training a model in the browser is the least practical use for tensorflow.js IMO (unless maybe you want to hijack people's browsers to help with training or something).
Re: Tensorflow.js – A Practical Guide
#10Earlier quoted context omitted.
It's a high-performance-computing framework that allows you to specify matrix and vector math expressions in terms of a graph structure. In exchange, you get automatic derivative calculation, and a somewhat easier ability to distribute complicated calculations across processors. HN people are mainly interested in it because it's one of the major frameworks for creating neural networks. Also because Google. The framew…
There are many reasons to do it in JavaScript: - 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. It's quite a lot to ask them to pull in a python runtime just to make a prediction. TensorFlow.js with node bindings to TensorFlow C enables this type of inference with minimal overhead. - Privacy. You can make pred…
"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.