Hi and welcome back.
Now we explore how guns actually work.
But before we do, let's take a look at this famous quote by Richard Feynman, the theoretical physicist.
What I cannot create, I do not understand.
So if let's think about something, if our gardens are creating new images that plausibly came from
an existing dataset, do they actually understand what our dataset represents?
Well, probably no, because they don't have a consciousness itself.
But guns do not live in the discriminator and degenerate to which we'll talk about shortly.
You learn to understand a lot about the dataset, so it's quite cool to think about this.
So let's get started.
So let's start with an analogy.
Imagine this an ambitious young criminal who wants to counterfeit money and sell it to a mobster.
Now this mobster over here, he's an expert in identifying whether counterfeit money is looks real or
not.
So let's see what happens.
So at first, as expected of a mature counterfeit is no good what he does.
He creates some fake bills and then gives the mobster some mix of some fake bills and some real ones.
And he gives it to a mobster to identify which of which set him up so he can see basically how good
the mobster is at identifying fake both so the mobsters and initially in the beginning stages, is able
to tell him all of these bills look fake compared to the real ones.
So he needs to get better.
So what does he do?
Well, he learns from the mobster that he has to make changes to his bills, so he keeps making improvement
and then eventually he gets so good.
He does this.
He repeatedly over and over, he makes fake bills and improve, keeps improving over and over until
he reaches a point where he's basically very, very good at almost fooling the mobster or basically
fooling him most of the time.
That's quite good.
So in this sense?
Remember, both of them would be getting better.
The armature counterfeiter he is going to get better at making fake counterfeit money.
But our expert or mobster, he's going to get better at spotting fakes as well.
So they both get better simultaneously.
And what that leads to is very good quality fake money, fake counterfeit money.
So this is an analogy that represents the two building blocks of the two main components of guns.
We have a generator network, which is a young criminal counterfeit mastermind here, and then the discriminator
is a mobster.
He's our expert.
He learns to basically discriminate between what's real and what's fake.
So that's basically how guns are built.
The purpose of the generated network is to take random data initialization and decode it into a synthetic
sample, basically to generate fake data.
Now the purpose of the discriminator, then take this input from our generator and predict whether the
sample came from the real dataset or not.
It's quite simple, isn't it?
So this is a basic gun architecture here.
So what happens?
We just have to live in space representation of our dataset.
We apply some noise to that and we give it our generator here, who then makes two fake images based
on this latent space knowledge of the dataset that he is slowly learning all the time, but initially
doesn't have any knowledge.
And he makes the fake money and the fake money goes to discriminator, along with some real money and
discriminator know has to decide whether each input is real or fake.
So remember, we know the ground truth.
We know what's real.
We know what's fake.
So this is how we trained the discriminator and his results.
Has this loss results basically fed back to discriminator and as well as feedback to the generator so
that they both can learn to improve over time?
So let's talk about adversarial games in Gans.
We basically have two adversarial networks that's the generator and discriminator where they're both
being trained to win over the other.
So this function below serves as a joint close function or a value function.
So remember, there are two losses that here both simultaneously trying to live together.
So it's an effectively a minimax game where to discriminate is trying to maximize its chances of winning
while the generator is trying to minimize its chances of losing.
Quite interesting and quite quite mathematically interesting and complex as well.
So we'll stop there for no.
And in the next section, we'll take a look at how we can actually train our guns.
So you have a good understanding of what the generator network does, what the discriminant Nathan that
were does, and now we can take a look and.
See how we actually train again when a real data set.
So stay tuned for the next next lesson, and thanks for watching.