YUFENG GUO: Hey, did you know that TensorFlow now
supports JavaScript?
Well, if you didn't, now you do.
Stay tuned to find out how to run TensorFlow
on the most widely used programming
language in the world.
[MUSIC PLAYING]
[BEEPING]
Welcome to Cloud AI Adventures, where
we explore the art, science, and tools of machine learning.
My name is Yufeng Guo, and on this episode,
we'll unpack TensorFlow.js a little bit
and show you some of the amazing things that you can do with it.
I'm sure you'll come up with your own epic use cases
by the end of this.
So let's dive right in.
TensorFlow.js lives at js.tensorflow.org.
There you can find all the documentation, tutorials,
and links to awesome examples.
The tutorials really do a great job
of layering on top of each other,
building up your TensorFlow.js skills.
Start at the top of the page and work your way down one by one.
Along the way, you'll train a convolutional neural network
in your browser and create a Pac-Man game.
Now, you can play with data you record with your webcam.
So what else have people made with TensorFlow.js?
Well, for one, there's PoseNet, which
does a pretty impressive job at identifying
your position in an image.
OK, so that silliness aside, what else
is TensorFlow.js good for?
Well, you can import your TensorFlow and Keras models
directly into the browser now.
This enables you to train complex models with large data
sets--
just like you're used to doing--
and then bring those models straight into the browser.
And we'll actually see an example
of that in a future episode of AI Adventures.
So keep your eye out.
Now, if you really want to get fancy,
you can take an imported model in TensorFlow.js
and then further train it.
So imagine loading in an existing state of the art
research model, then adding some of your own training data
to specialize that model in some way,
maybe with images from the webcam.
So some of you may be wondering, hey,
what's the relationship between TensorFlow.js
and this other library, deeplearn.js?
Well, TensorFlow.js is a whole ecosystem of JavaScript tools
for machine learning.
And it actually evolved from deeplearn.js.
That portion is now known as TensorFlow.js Core.
The rest of TensorFlow.js features
additional functionality and tools
to help make doing machine learning in JavaScript easier.
Another big question around doing machine learning
with JavaScript is performance.
Anecdotally, for predictions, TensorFlow.js with WebGL
is about one and half to two times slower
than TensorFlow using Python with AVX enabled.
On the training side, we've seen that large models train
actually 10 or even 15 times slower in a browser
compared with TensorFlow on Python.
So while it's unlikely that TensorFlow.js will completely
replace the raw performance of server side training,
there are some amazing experiences
to be created via client side machine learning.
This was just the quick overview of TensorFlow.js.
I was super excited at the fact that this is out in the wild.
So I really needed to get this to you
so you can get started as soon as possible.
We'll spend some more time with TensorFlow.js
in future episodes and look at some tips
and tricks in more detail.
Thanks for watching this episode of Cloud AI Adventures.
And if you enjoyed it, please hit that Like button
and subscribe to get all the latest episodes right
when they come out.
For now, head on over to js.tensorflow.org and get
started today.