(upbeat music)
- In this video, I'm going to give you
a very quick introduction to how our transformer models
work together with Tensorflow and Keras.
The very short explanation
is that all of our Tensorflow models
are also Keras model objects,
and so they have the standard Keras model API.
If you're an experienced machine learning engineer
who's used Keras a lot, that's probably all you need to know
to start working with them.
But for everyone else,
including the prodigal PyTorch engineers out there
who are returning to the fold,
I'm going to quickly introduce Keras models,
and how we work with them.
In other videos, which I'll link below,
I'll run through training with Keras models in more detail.
But first, at a high level, what is a Keras model?
So your model basically contains your entire network.
It contains the layers, and the weights for those layers,
and also tells the model what to do with them
so it defines the whole path all the way
from your inputs to your outputs.
If you've used Keras before,
you probably started using model objects
by building them out by hand,
you added one layer after another
and maybe using the model.add() or the functional approach.
And there's nothing wrong with that.
Lots of great models are built that way
but you can also pre-load an entire model, weights and all.
And this is really helpful, because if you,
as you can see here, if you try reading the paper
or if you try looking at the code,
you'll see the inside of a Transformer is pretty complex,
and writing it all out from scratch and getting it right
would be hard even for an experienced
machine learning engineer.
But because it's all packed inside a model,
you don't need to worry about that complexity on that
if you don't want to.
If you're a researcher, if you want to really dig in there
you can, but you can also just load a pre-trained,
pre-configured transformer model in just one line of code.
And when I mentioned earlier about the Keras API,
the advantage of it is that
whether you write your own model from scratch
or load a pre-trained one, you interact with the model
through that same API, so you use exactly
the same few methods and you're gonna see them
again and again, these methods like fit,
compile and predict, and like I've mentioned
we'll cover concrete examples of how to use those methods
in the videos I'll link below.
For now the key thing to take away from this video,
if you've never seen Keras before,
is that this neat encapsulation means
that all the complexity of a huge neural net
becomes manageable, because you interact with it
in exactly the same way, using exactly the same methods,
whether it's a huge pre-trained language model
or a simple model that you wrote out by hand.
(upbeat music)