Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
1
Hello and welcome to the practical applications of module three deep convolutional Gants Gannes mean
2
generative adversarial networks and there are the new big thing in deep learning that I use today to
3
do some amazing stuff.
4
One of these things is to generate some fake images based on the vision of real images and that's exactly
5
what we'll do in this Mudgal and it's part of computer vision because the Gannes will have eyes through
6
the convolutional layers to watch all these images and then train itself to reproduce some fake images.
7
But then you have some other amazing applications of gangs that are for example style transfer or face
8
where you can make a face weap with cycle Gannes basically Gannes other cutting edge Morell's income
9
television.
10
So I'm super excited to implement it with you in this Mudgal 3.
11
And the good news is that this time we will implement the whole model from scratch and this not only
12
includes the generation of the images that is we're not going to take a pre-trained moralizing module
13
to to generate some fake images.
14
We're going to make the whole thing from scratch.
15
And by that I mean we're going to make a brain we're going to create a brain which will have some eyes
16
and we're going to train that brain to make it smart and smart.
17
I mean capable of generating some fake images based on the vision of a lot and lots of real images these
18
real images will get them from C4 10 which is a very well known data set containing lots and lots of
19
images that will be the real images on which are deep convolutional Gannes will be trained and based
20
on its training.
21
It will then be smart enough to generate some fake images and you're going to see that fake images.
22
I'm not talking about some random gradients of colors.
23
It really looks like something real.
24
So you'll see that in the end we will see that in the final tutorial of this module as usual.
25
And now if you're ready we're going to start implementing this model from scratch.
26
The deep convolutional Ganns.
27
So the first thing we're going to do is open Anaconda because I want to make sure you don't forget to
28
connect to the virtual platform.
29
There we go.
30
So you go to applications on virtual platform and right after it's loaded you click on launch here to
31
launch the spider ID right.
32
Spiders coming in here is spider.
33
OK so now we have to set the right for them as working directory.
34
So we're going to go to File Explorer.
35
We're going to go to where your computer vision is that folder it is on my desktop.
36
We go inside the computer vision it is a folder and now I have to say congratulations you reached module
37
3.
38
This is going to be a big module.
39
We're going to implement a real huge powerful computer vision model from scratch including the training.
40
So let's do this let's go inside module three and ask for Module 1 and 2.
41
You have to code this again commented we're going to look at that right now by the way because I really
42
want you to get the structure of the code and we have our implementation that we'll do ourselves.
43
It contains more than 100 lines of code.
44
So that's quite a challenge but we'll make it.
45
But before we make it I would like to as I just said show you the structure of the code.
46
So that's the code.
47
All the lines of the code argumenta and you can have a clear global view of the structure.
48
It's important sometimes to take a step back and visualize the structure.
49
That's exactly what we're going to do now.
50
So we start by importing all the libraries.
51
So that's almost the same as before except this time we're going to use towards vision to visualize
52
the images.
53
Then we set the values of some hyper parameters like the batch size the image size that is.
54
We set the size of the generated images to 64 by 64.
55
Then we create some transformations exactly like in module to we'll use some transformations to make
56
the input images compatible with the neural network of the generator.
57
Prepare yourself.
58
This time we're going to have two neural networks.
59
We're going to have the neural network of the generator and the neural network of the discriminator.
60
So that's going to be something but these transformations are for the generator.
61
Then we load the data set from this folder here data that contains the site far 10 data set in batches.
62
So we just love the data set from this folder.
63
As you can see here route we take this data folder and then we use torche utils data data loader to
64
get the images of the data set batch by batch.
65
Indeed as you can see we specify here the batch size to specify the size of the batch.
66
And then we use this shuffle equals true here just so that we can get the images in a random order.
67
All right.
68
And then none.
69
Workers equals true means that we're going to have two parallel threads that will load the data and
70
using the data loader with this shuffle.
71
And two threads allows us in fact to get the data faster much faster when the data sets are huge which
72
is the case for C40 and data set.
73
All right then we define the weights in it function that will take as input a neural network and that
74
will initialize all the weights of the neural network.
75
So we will apply the weights and it function to both the neural networks that is the new network of
76
the generator and a neural network of the discriminator to initialize all the weights.
77
The right way for the adversarial networks.
78
And then here comes the structure.
79
I really want to highlight and then I really want you to have a clear understanding.
80
That's super important before we tackle this.
81
So the further we're going to do is defining the generator and we are going to define it through a class
82
that's the best way to define a neural network.
83
So we will define the architecture of the new one that work in this first class G which will contain
84
this architecture and the forward function that will propagate the signal inside this neural network.
85
Then once we define our generator with this class we'll be able to create the generator itself which
86
will be an object of the G class.
87
So that's the first important section of the structure of the code.
88
Then once we're done with the generator we'll take care of the discriminator and same well-defined architecture
89
of the discriminator.
90
With this class D which will contain the architecture itself and same the forward function that will
91
propagate the signal inside the neural network of the discriminator then once we define all this we'll
92
be able to create the discriminator itself by creating an object of this previous class declasse and
93
then that will be a huge step down because we will have created the brain of our computer vision model
94
because the brain is composed of the generator and the discriminator.
95
But then we will just have a brain a brain that is not trained yet.
96
So our hands will still be stupid and therefore we will need to train it.
97
And that's exactly the last section of the code where we will train the DC Gannes by training two brains
98
at the same time you know we have this big brain of the DC again that is composed of two brain the brain
99
there is a neural network or the generator and the other brain the neural network of the discriminator.
100
So we will train these two brains at the same time according to the process that you saw with curial
101
in the intuition lectures.
102
That is you know we first trained a generator with a real image of the data set.
103
Then we trained the discriminator with a fake image generated before by the generator.
104
That's the first subset of this big step here.
105
And then the second subset is two of them the weight of the neural network of the generator.
106
So we will see that in details great details actually we will code each of these lines of code base
107
planning what's going on and eventually after we're done with the implementation of the section not
108
only will we have brains but also these brains will be smart enough to generate some images and since
109
they'll be smart enough.
110
Well of course we'll make them generate some fake images and we'll see these fake images in the last
111
tutorial.
112
So I can't wait to start.
113
I'm super excited to code all this with you.
114
I'm going to close this now.
115
And here we are back in our non-committed version of the code that is the code where we'll implement
116
the whole model.
117
I already prepared the first sections here where we import the library said the hyper parameters create
118
the transformations load the data set and define the weights in it function so that we can directly
119
Diven to the implementation of our future smart brains.
120
So let's do this and getting back into my replow data.
121
Oh and by the way this last fall the result is an empty folder so far but that will exactly be the folder
122
that will be populated with the fake images of our decisions.
123
So here we go let's tackle our deep convolutional Ganns And let's start in the next tutorial.
124
Until then enjoy computer vision.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.