top | item 17303712

Tensorflow.js – A Practical Guide

178 points| jaya-yellowant | 7 years ago |blog.yellowant.com | reply

31 comments

order
[+] zawerf|7 years ago|reply
The most practical use not mentioned here is probably to import existing trained models/weights. I can see it being useful for anything that you want to run in real-time (e.g., webcams apps like https://github.com/ModelDepot/tfjs-yolo-tiny) and can't pay a round-trip cost to server.

https://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).

[+] jorgemf|7 years ago|reply
> Training a model in the browser is the least practical use for tensorflow.js

Unless you want to do some type of federated training in real time without sending private information to the servers (very unusual case in my opinion)

[+] galfarragem|7 years ago|reply
Noob question: Can anybody tell in a few sentences of plain english what is tensorflow, how it works and why seems to be so relevant?
[+] quadrature|7 years ago|reply
A lot of problems boil down to optimizing a cost function. This function could be the error in recognizing cat pictures or the likelihood of recommending a movie to a user.

What people want is an easy way to express these functions so that a computer can optimize it for them. Tensorflow allows people to do just that, it lets you represent your mathematical equation in a way that can be analyzed and optimized by a computer.

It does it by exposing various mathematical operations that it understands[1]. As long as you can express your mathematical function using these operations then Tensorflow knows how to compute it efficiently and you can use its optimizer to find the optimal inputs.

comes in handy for a lot of problems.

[1] https://www.tensorflow.org/api_guides/python/math_ops

[+] s-macke|7 years ago|reply
Tensorflow tries to fit the free parameters (usually millions of parameters) of a function y=f(x). The fitting algorithm gets usually thousands or millions of examples of how the output y for a given input x has to look like.

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.

[+] timr|7 years ago|reply
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 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.

[+] bitL|7 years ago|reply
Is there a TF/Keras in Python to JavaScript transpiler somewhere? I don't want to waste time retyping complex methods to JS. Thanks for any suggestion!
[+] burkel24|7 years ago|reply
You were so busy figuring out if you could, you didn't stop to wonder if you should…

Joking aside this is super cool

[+] gaius|7 years ago|reply
I was going to upvote you ‘til I read the last line