[MUSIC PLAYING]
JASON MAYES: In the last few chapters,
you've taken a deeper dive into creating your own models
in JavaScript and reusing existing models via transfer
learning.
Now, both are very powerful things to know,
but sometimes, the models you want to reuse
might not be in the programming language of your choice.
Maybe you saw some cutting-edge research come out
over in Python and you're curious to see
if it will run in the web browser
to make that cool idea you had become a reality to millions
of people in a scalable way.
At the time of writing this course, many folks in academia
use the Python programming language, for example.
And as such, many of those models
are stored in the TensorFlow Python model
format, which can not run client-side in the browser.
As more JavaScript developers learn machine learning just
like you, this may actually change over time,
as you already know how to make your own models
from a blank canvas in pure JavaScript.
But for now, if you want to make use of such research models
in the browser, you will need to convert them
to the TensorFlow GS model format to be consumed there.
Now do note, however, if you want to use Python-safe models
server-side within Node.js, then no conversion is needed as both
Python and Node are just wrappers around the C++ core,
so they do not need any conversion and are
interoperable in that regard.
Now, this chapter only applies to client-side browser model
usage.
OK, so what are the benefits of doing this conversion?
I mean, why not just keep it all server-side?
Well, you've learned at the start of this course
some of the superpowers of executing in the browser--
like privacy, cost, and speed--
as you can execute on-device with direct access
to the sensors.
But in addition, you get the following three benefits.
First, you can give your team or community access
to a larger range of models and research.
Secondly, it could give you access to cutting-edge research
faster in a form that's more suitable for production.
And finally, by converting a research model to JavaScript,
you can get more eyes and feedback on that research model
as there are far more people with web browsers
out there than there are people who know how to set up and code
on a Linux server.
So diving into that last point, what
if you could get research models into the hands of more
front-end users?
What we see here is the typical approach needed
for server-side environments.
First, you must install Linux, then CUDA.
Install TensorFlow; clone some GitHub repository;
read the docs; install the dependencies;
and then maybe, if everything is on your side,
it works and you can run the example.
On the web, anyone can visit a website,
as you've seen throughout this course, and it just works.
Even more engineers and creative folk
can then start to explore the power of cutting-edge research
for their ideas in minutes instead of hours or even days.
And then they can see if it's a good fit for their needs
before committing more time and effort to go deeper.
Now, many of these potential new users
are aware of the new research coming out,
but are unsure how to get started.
Often, there's a programming language barrier
or added friction to usage, as you just saw.
And offering a web-accessible model
could encourage more users to try such a model
in their respective industries, even if they're not
ML experts themselves, which, in turn, will
drive innovation and new ideas.
Now, these ideas and use cases could
lead to valuable feedback for researchers
as the industries the model would be exposed to
may be far greater than ever before.
And this feedback and discovery of potential biases
for real-world applications could then
drive further improvements to the research model itself,
thus enabling creation of better models further down the line,
leading to a positive feedback loop of new research model
consumption, industrial innovation
and prototyping at scale, which in turn drives
new innovations for edge cases discovered.
This is, in fact how we're working here
at Google, which has led to improvements
in our post-estimation models like our movement model,
for example, which, after launch, received feedback
from companies in the healthcare industry, who we then
collaborated with to produce an even
higher-quality model that's now available to everybody.
Now, in this chapter, you'll learn the basics
of retraining and converting Python models
to empower you to bring popular models
to your fellow JavaScript developers or communities
that you might be active in.
So let's get started.
[MUSIC PLAYING]