1
00:00:00,510 --> 00:00:01,710
Hi and welcome back.

2
00:00:02,370 --> 00:00:05,250
Now we explore how guns actually work.

3
00:00:05,610 --> 00:00:11,280
But before we do, let's take a look at this famous quote by Richard Feynman, the theoretical physicist.

4
00:00:11,910 --> 00:00:14,610
What I cannot create, I do not understand.

5
00:00:15,330 --> 00:00:21,870
So if let's think about something, if our gardens are creating new images that plausibly came from

6
00:00:21,870 --> 00:00:26,670
an existing dataset, do they actually understand what our dataset represents?

7
00:00:26,730 --> 00:00:30,600
Well, probably no, because they don't have a consciousness itself.

8
00:00:31,080 --> 00:00:35,940
But guns do not live in the discriminator and degenerate to which we'll talk about shortly.

9
00:00:36,450 --> 00:00:41,700
You learn to understand a lot about the dataset, so it's quite cool to think about this.

10
00:00:42,330 --> 00:00:43,320
So let's get started.

11
00:00:45,450 --> 00:00:47,220
So let's start with an analogy.

12
00:00:47,400 --> 00:00:53,340
Imagine this an ambitious young criminal who wants to counterfeit money and sell it to a mobster.

13
00:00:53,730 --> 00:01:00,570
Now this mobster over here, he's an expert in identifying whether counterfeit money is looks real or

14
00:01:00,570 --> 00:01:00,930
not.

15
00:01:01,560 --> 00:01:02,940
So let's see what happens.

16
00:01:04,500 --> 00:01:10,020
So at first, as expected of a mature counterfeit is no good what he does.

17
00:01:10,020 --> 00:01:16,470
He creates some fake bills and then gives the mobster some mix of some fake bills and some real ones.

18
00:01:16,800 --> 00:01:22,740
And he gives it to a mobster to identify which of which set him up so he can see basically how good

19
00:01:22,740 --> 00:01:28,740
the mobster is at identifying fake both so the mobsters and initially in the beginning stages, is able

20
00:01:28,740 --> 00:01:32,280
to tell him all of these bills look fake compared to the real ones.

21
00:01:32,820 --> 00:01:34,260
So he needs to get better.

22
00:01:34,650 --> 00:01:35,670
So what does he do?

23
00:01:35,790 --> 00:01:43,050
Well, he learns from the mobster that he has to make changes to his bills, so he keeps making improvement

24
00:01:43,050 --> 00:01:45,150
and then eventually he gets so good.

25
00:01:45,510 --> 00:01:46,170
He does this.

26
00:01:46,170 --> 00:01:52,260
He repeatedly over and over, he makes fake bills and improve, keeps improving over and over until

27
00:01:52,260 --> 00:01:58,680
he reaches a point where he's basically very, very good at almost fooling the mobster or basically

28
00:01:58,680 --> 00:02:00,420
fooling him most of the time.

29
00:02:00,850 --> 00:02:01,590
That's quite good.

30
00:02:02,160 --> 00:02:04,100
So in this sense?

31
00:02:04,530 --> 00:02:06,540
Remember, both of them would be getting better.

32
00:02:07,200 --> 00:02:12,300
The armature counterfeiter he is going to get better at making fake counterfeit money.

33
00:02:12,780 --> 00:02:17,310
But our expert or mobster, he's going to get better at spotting fakes as well.

34
00:02:17,820 --> 00:02:19,920
So they both get better simultaneously.

35
00:02:19,920 --> 00:02:25,770
And what that leads to is very good quality fake money, fake counterfeit money.

36
00:02:27,120 --> 00:02:32,970
So this is an analogy that represents the two building blocks of the two main components of guns.

37
00:02:33,540 --> 00:02:40,860
We have a generator network, which is a young criminal counterfeit mastermind here, and then the discriminator

38
00:02:41,100 --> 00:02:42,000
is a mobster.

39
00:02:42,030 --> 00:02:43,080
He's our expert.

40
00:02:43,530 --> 00:02:47,160
He learns to basically discriminate between what's real and what's fake.

41
00:02:48,150 --> 00:02:51,330
So that's basically how guns are built.

42
00:02:51,810 --> 00:02:58,470
The purpose of the generated network is to take random data initialization and decode it into a synthetic

43
00:02:58,470 --> 00:03:01,470
sample, basically to generate fake data.

44
00:03:01,980 --> 00:03:07,230
Now the purpose of the discriminator, then take this input from our generator and predict whether the

45
00:03:07,240 --> 00:03:09,840
sample came from the real dataset or not.

46
00:03:10,380 --> 00:03:11,430
It's quite simple, isn't it?

47
00:03:12,600 --> 00:03:14,910
So this is a basic gun architecture here.

48
00:03:15,360 --> 00:03:16,380
So what happens?

49
00:03:16,380 --> 00:03:19,680
We just have to live in space representation of our dataset.

50
00:03:20,670 --> 00:03:27,570
We apply some noise to that and we give it our generator here, who then makes two fake images based

51
00:03:27,570 --> 00:03:32,550
on this latent space knowledge of the dataset that he is slowly learning all the time, but initially

52
00:03:32,580 --> 00:03:33,600
doesn't have any knowledge.

53
00:03:34,110 --> 00:03:40,920
And he makes the fake money and the fake money goes to discriminator, along with some real money and

54
00:03:40,920 --> 00:03:45,540
discriminator know has to decide whether each input is real or fake.

55
00:03:46,020 --> 00:03:48,030
So remember, we know the ground truth.

56
00:03:48,090 --> 00:03:48,930
We know what's real.

57
00:03:48,930 --> 00:03:49,740
We know what's fake.

58
00:03:50,130 --> 00:03:53,530
So this is how we trained the discriminator and his results.

59
00:03:53,570 --> 00:04:01,020
Has this loss results basically fed back to discriminator and as well as feedback to the generator so

60
00:04:01,020 --> 00:04:03,870
that they both can learn to improve over time?

61
00:04:06,210 --> 00:04:09,810
So let's talk about adversarial games in Gans.

62
00:04:09,810 --> 00:04:15,840
We basically have two adversarial networks that's the generator and discriminator where they're both

63
00:04:15,840 --> 00:04:17,940
being trained to win over the other.

64
00:04:18,600 --> 00:04:24,180
So this function below serves as a joint close function or a value function.

65
00:04:24,840 --> 00:04:29,810
So remember, there are two losses that here both simultaneously trying to live together.

66
00:04:30,220 --> 00:04:36,030
So it's an effectively a minimax game where to discriminate is trying to maximize its chances of winning

67
00:04:36,420 --> 00:04:39,480
while the generator is trying to minimize its chances of losing.

68
00:04:40,020 --> 00:04:44,550
Quite interesting and quite quite mathematically interesting and complex as well.

69
00:04:45,900 --> 00:04:47,370
So we'll stop there for no.

70
00:04:47,880 --> 00:04:51,930
And in the next section, we'll take a look at how we can actually train our guns.

71
00:04:52,350 --> 00:04:57,930
So you have a good understanding of what the generator network does, what the discriminant Nathan that

72
00:04:57,930 --> 00:04:59,960
were does, and now we can take a look and.

73
00:05:00,030 --> 00:05:03,690
See how we actually train again when a real data set.

74
00:05:04,140 --> 00:05:07,290
So stay tuned for the next next lesson, and thanks for watching.
