Welcome to section three of the Mastering
Keras course. In this section, we're
going to be looking at how to develop
and implement deep generative models and
in particular, we're going to be looking
at GANs and autoencoders. So I'll talk
about them briefly in this introductory
video and here we'll also talk a little
bit about what these generative models
can do for you and in particular, what
we're going to look at them doing in
this course. So we're going to look at
how to implement two important
generative models. We're going to look at
generative adversarial networks GANs and
these are very well known very powerful
neural network models. They're also
notorious for use cases such as deep
fakes. Second sort of model will look at
variational autoencoders. Now we're going
to use these generative models to
generate synthetic data, something which
can be used to assist other learning
tasks. So synthetic data is going to be
useful to you when there is insufficient
or inadequate training data available.
Now being insufficient is pretty
self-explanatory. If you just don't have
enough data, you need to supplement the
real ground truth training data that you
have with synthetic data just to have
sufficient data to be able to train your
deep learning models. But data can also
be inadequate for various reasons. It can
be that your data lacks sufficient
variety or even if you have a lot of
data, you may have insufficient data of
particular classes. And this is a really
really common problem in a lot of
real-world use cases, particularly
situations where you're attempting to
predict positive cases that occur
extremely rarely. And so for an example
that I've worked on where you're trying
to predict faults in critical industrial
machinery, situations where their systems
on say an oil rig or manufacturing
process and you want to predict when a
fault will occur in these systems. But of
course these are very sophisticated
systems, people have put a lot of effort
into making sure these faults don't
occur, may have a lot of historical data
you know years or decades worth. There's
likely to be extraordinarily few data
cases where a fault has actually
occurred, so you have lots of data but
you have insufficient positive cases. So
three ways in which synthetic data is
often generated. It can be that you want
to generate data that are representative
of plausible real-life cases that you
can prespecify how these can be
generated from available data by say
transformations. And a particularly usual
case of this is with image analysis
where for example, you can rotate the
image or you can change the color and
shading a little bit. Because if you have
a handwritten digit that's a 6, you can
also obviously expect to see this digit
slightly rotated or slightly moved
off-center, so forth. These are very
simple. We know beforehand how we can
generate plausible synthetic data from
the real-life cases by simple
transformations. Other synthetic data
you're going to want to use occasionally
are data that's just general, that is
similar to the available data in general.
And this is going to be particularly the
case when you simply have insufficient
data.
In the other situation where you've got
sufficient data but there's particular
subsets or particular classes of your
data that is insufficient, you're going
to want synthetic data that is similar
to say the particular class which is of
insufficient number in your available
data. So we're going to be using GANs and
variational autoencoders to produce 2,
that is to say data, synthetic data that
is similar to available data in general.
We're also going to be using variational
autoencoders to produce three synthetic
data that is similar to a particular
class or case from the available data. As
well as being able to produce synthetic
data, GANs can also be used to transform
input data to better resemble target
data. And a particularly notorious case
of this is deep fakes where you can
train up GANs to take images say of
myself and transform them to look like
images of say Barack Obama, while doing
the same thing to my audio so that you
take audio clips of me speaking and
transform it to appear to sound like
Barack Obama. And put this all together,
you can create a fake video of Barack
Obama or what appears to be Barack Obama
speaking but really it's me speaking and
it's being transformed to a fake video
where I get an image of
Barack Obama to say what I want him to say.
GANs are also particularly important in
this course for two reasons. Firstly, the
way in which we train GANs and in
particular how we train the generative
component of GANs is analogous to how
we're going to end up training actor
critic models in reinforcement learning.
You'll see that when we look at GANs we
will train the generative component of
the GAN by training it through the
discriminator component. And similarly, in
the actor critic model, we're going to be
training the actor component by training
it through the critic component of the
model. Also, we're going to come back to
GANs and see how they can be used for
semi-supervised learning. Now for those
of you who aren't familiar with
semi-supervised learning, supervised
learning is where we have that includes
input features as well as target
variables. And our aim is to obtain a
model that discovers the patterns
between the input features and the
target variables so as to be able to
predict the target variable given new
input features. Unsupervised learning is
a situation where we have no target
variables and we're simply trying to
discover patterns inside the input
feature data, and clustering is
prototypical of this. But semi-supervised
learning is where we do, once again like
the supervised case have input features
and target variables and we want to
discover a pattern between the two. But
in this case, most of our training data
is unlabeled. We may have labels for some,
we may have known target variable values
for some of our training data but
overwhelmingly or at least in part our
training data has no labels. And we'll
see how we can use GANs to perform
semi-supervised learning to assist us in
our in discovering the relationship
between input features and target
variables, while making use of a lot of
unlabeled data which is to say historic
data that has no known value for the
target variables. Okay, so now we'll move
on to looking at how to implement GANs
in Keras and how to use these for
generating synthetic data.