1
00:00:00,000 --> 00:00:00,000
Hello guys.

2
00:00:00,000 --> 00:00:04,000
So we are going to continue the discussion with respect to artificial neural network.

3
00:00:04,000 --> 00:00:10,000
Now in this video and in the upcoming series of video, we are going to develop an end to end project

4
00:00:10,000 --> 00:00:16,000
using deep learning, where we are specifically going to train a artificial neural network here.

5
00:00:16,000 --> 00:00:23,000
Uh, one of the two most important libraries that we are going to use is Keras and TensorFlow.

6
00:00:23,000 --> 00:00:26,000
Okay, so TensorFlow is over here and Keras is over here.

7
00:00:26,000 --> 00:00:32,000
Now if you don't know about TensorFlow this is an open source, uh, library specifically used to create

8
00:00:32,000 --> 00:00:34,000
end to end deep learning projects.

9
00:00:34,000 --> 00:00:37,000
And, uh, it has some amazing features.

10
00:00:37,000 --> 00:00:44,000
And, uh, you know, you will be able to implement various kind of neural networks from an to RNN to

11
00:00:44,000 --> 00:00:49,000
LSTM, RNN to GRU to transformer each and everything you will be able to implement from this.

12
00:00:49,000 --> 00:00:55,000
Now, many people may be thinking, Chris, is it a good idea to probably create all these specific

13
00:00:55,000 --> 00:00:58,000
models and train all these neural networks completely from scratch?

14
00:00:58,000 --> 00:01:02,000
I would suggest guys right now, since all these libraries are open source, right?

15
00:01:02,000 --> 00:01:04,000
Like you have TensorFlow, you have PyTorch.

16
00:01:04,000 --> 00:01:08,000
And I would always suggest you be an expertise of one of this.

17
00:01:08,000 --> 00:01:14,000
You know, uh, you need not learn both the libraries because at the end of the day, when we start

18
00:01:14,000 --> 00:01:21,000
learning generative AI, or when you will be learning generative AI there are all the LM models, all

19
00:01:21,000 --> 00:01:24,000
the generative AI models that we will be specifically using.

20
00:01:24,000 --> 00:01:29,000
In the back end, we will be able to convert or, uh, change the libraries from PyTorch to TensorFlow

21
00:01:29,000 --> 00:01:30,000
at any point of time.

22
00:01:30,000 --> 00:01:36,000
So again, uh, my suggestion would be learn any one of the specific libraries and learn how to build

23
00:01:36,000 --> 00:01:36,000
end to end projects.

24
00:01:36,000 --> 00:01:38,000
That is very much important.

25
00:01:38,000 --> 00:01:41,000
So in this course we will be focusing more on TensorFlow.

26
00:01:41,000 --> 00:01:45,000
And we will try to create end to end projects with the help of machine learning.

27
00:01:45,000 --> 00:01:49,000
Uh, I mean deep learning uh, like an we will try to see how we can train.

28
00:01:49,000 --> 00:01:53,000
And again, along with TensorFlow we will also be using this Keras API.

29
00:01:53,000 --> 00:01:57,000
Now Keras is just like a wrapper on top of TensorFlow you know.

30
00:01:57,000 --> 00:02:01,000
So in TensorFlow we will be able to create sequential neural network.

31
00:02:01,000 --> 00:02:07,000
We will be able to create RNN, will be able to create an will be able to create a LSTM uh RNN.

32
00:02:08,000 --> 00:02:12,000
So when we are creating all these things, we really need to write a lot of code.

33
00:02:12,000 --> 00:02:14,000
Uh, if we are only using TensorFlow.

34
00:02:14,000 --> 00:02:20,000
But if you go ahead and use Keras, which is again integrated into TensorFlow, this actually provides

35
00:02:20,000 --> 00:02:21,000
APIs.

36
00:02:21,000 --> 00:02:28,000
And this API is is so good that you will be able to call each and every thing, you'll be able to create

37
00:02:28,000 --> 00:02:31,000
your entire neural network just with less lines of code.

38
00:02:31,000 --> 00:02:34,000
Okay, but don't worry, I will be talking about it.

39
00:02:34,000 --> 00:02:37,000
So here you can see Keras also works with Jax, TensorFlow and PyTorch.

40
00:02:37,000 --> 00:02:38,000
Right now.

41
00:02:38,000 --> 00:02:40,000
In this course we will focus more on TensorFlow itself.

42
00:02:40,000 --> 00:02:41,000
Okay.

43
00:02:41,000 --> 00:02:47,000
So uh what is the problem statement that we are going to discuss okay so here I have a data set okay.

44
00:02:47,000 --> 00:02:51,000
So this data set is basically called as churn modeling dot CSV.

45
00:02:51,000 --> 00:02:58,000
And as you all know we use an to solve uh, you know if we have a tabular data, we, we have some classification

46
00:02:58,000 --> 00:03:01,000
or regression problem statement we will be able to solve with the help of an.

47
00:03:02,000 --> 00:03:05,000
So here you'll be able to see I have this churn modeling dot csv file.

48
00:03:06,000 --> 00:03:10,000
And here my output is something called as exited.

49
00:03:10,000 --> 00:03:14,000
Exited basically means this data is from a bank based on some information.

50
00:03:15,000 --> 00:03:20,000
Uh, the data is basically given that whether the person is going to leave the bank or not.

51
00:03:20,000 --> 00:03:20,000
Okay.

52
00:03:21,000 --> 00:03:26,000
And over here, these are the past data from this particular bank, which shows that this information

53
00:03:26,000 --> 00:03:28,000
was there and the person left the bank.

54
00:03:28,000 --> 00:03:31,000
When this informations are there, the person did not leave the bank.

55
00:03:31,000 --> 00:03:32,000
Okay.

56
00:03:32,000 --> 00:03:37,000
There are some features like credit score, geography, gender, age, tenure, balance, number of

57
00:03:37,000 --> 00:03:41,000
products, has credit card is active member estimated salary.

58
00:03:41,000 --> 00:03:45,000
And then here you specifically have whether the person has exited or not.

59
00:03:45,000 --> 00:03:46,000
Okay.

60
00:03:46,000 --> 00:03:51,000
So what we'll do is that we'll try to solve this simple binary classification problem again with the

61
00:03:51,000 --> 00:03:52,000
help of an.

62
00:03:52,000 --> 00:03:58,000
Here you will be seeing that whatever things we have learned in an right, uh, like how a neural network

63
00:03:58,000 --> 00:04:02,000
is basically created, how what forward propagation actually happens, backward propagation actually

64
00:04:02,000 --> 00:04:02,000
happens.

65
00:04:02,000 --> 00:04:07,000
How to calculate loss function, how to use optimizers that everything will be explained when we are

66
00:04:07,000 --> 00:04:08,000
creating this particular project.

67
00:04:08,000 --> 00:04:10,000
And this project will be completely end to end.

68
00:04:10,000 --> 00:04:11,000
We will also focus on the deployment.

69
00:04:11,000 --> 00:04:13,000
We'll try to create pickle files.

70
00:04:13,000 --> 00:04:14,000
I'll tell you why.

71
00:04:14,000 --> 00:04:16,000
Pickle files will be required over here each and every thing.

72
00:04:16,000 --> 00:04:17,000
Okay.

73
00:04:17,000 --> 00:04:21,000
So uh, this is the entire problem statement again.

74
00:04:21,000 --> 00:04:25,000
Uh, our main aim is that based on some features, we need to predict whether the person is going to

75
00:04:25,000 --> 00:04:26,000
leave the bank or not.

76
00:04:26,000 --> 00:04:32,000
Okay, so just to give you an idea of what exactly we are going to do in this particular project, first

77
00:04:32,000 --> 00:04:34,000
of all, we'll go and focus on classification.

78
00:04:34,000 --> 00:04:36,000
So here we have this particular data set.

79
00:04:36,000 --> 00:04:40,000
Now we will take this entire data set okay.

80
00:04:40,000 --> 00:04:42,000
We'll take this entire data set.

81
00:04:43,000 --> 00:04:48,000
We'll perform some of the basic feature engineering.

82
00:04:49,000 --> 00:04:49,000
Okay.

83
00:04:49,000 --> 00:04:51,000
Basic feature engineering.

84
00:04:51,000 --> 00:04:59,000
Now what all basic feature engineering we will do we will convert uh, let's say categorical variables.

85
00:05:01,000 --> 00:05:04,000
Into numerical.

86
00:05:05,000 --> 00:05:05,000
Okay.

87
00:05:05,000 --> 00:05:08,000
We'll convert this categorical variables into numerical.

88
00:05:08,000 --> 00:05:10,000
We'll be doing some processing.

89
00:05:10,000 --> 00:05:14,000
Uh, will will use some, uh, standardization process.

90
00:05:14,000 --> 00:05:15,000
Right.

91
00:05:15,000 --> 00:05:17,000
All these things we will specifically.

92
00:05:17,000 --> 00:05:21,000
So this is the first step, some type of basic engineering where we will be transforming the entire

93
00:05:21,000 --> 00:05:22,000
data.

94
00:05:22,000 --> 00:05:27,000
After we do this, we will be getting our good data itself that will be available with us.

95
00:05:27,000 --> 00:05:30,000
Then we will try to create an an.

96
00:05:30,000 --> 00:05:34,000
So if I just consider as an example with respect to an, let's say in this particular feature, you

97
00:05:34,000 --> 00:05:38,000
have uh, 11 features, okay, in 11 independent features.

98
00:05:38,000 --> 00:05:42,000
So this will basically be my input layer, okay.

99
00:05:42,000 --> 00:05:46,000
With 11 nodes like this I've just written dot dot.

100
00:05:46,000 --> 00:05:48,000
Then we will go ahead and create our hidden layer.

101
00:05:49,000 --> 00:05:54,000
Okay, let's say this is my hidden layer that I'm actually going to create one more hidden layer I can

102
00:05:54,000 --> 00:05:55,000
create over here.

103
00:05:55,000 --> 00:05:55,000
Okay.

104
00:05:55,000 --> 00:05:59,000
It is up to us how many hidden layers you will be creating and all.

105
00:05:59,000 --> 00:06:04,000
And then finally you know that this is basically giving you an output as one, right?

106
00:06:04,000 --> 00:06:06,000
So here I will be having an output as one.

107
00:06:06,000 --> 00:06:10,000
And finally we will go ahead and basically will create this entire CNN.

108
00:06:10,000 --> 00:06:13,000
And as you all know this will be interconnected, right?

109
00:06:13,000 --> 00:06:14,000
This will be interconnected.

110
00:06:14,000 --> 00:06:17,000
So I think you can go ahead and do the connection.

111
00:06:17,000 --> 00:06:20,000
I'm just doing one part of the connection.

112
00:06:20,000 --> 00:06:24,000
And this is finally going to go ahead with the output layer okay.

113
00:06:24,000 --> 00:06:28,000
Uh, here I will also show you how you can apply dropout.

114
00:06:28,000 --> 00:06:29,000
Okay.

115
00:06:29,000 --> 00:06:34,000
Dropout basically means uh, some of the nodes I will disable it while doing the forward propagation

116
00:06:34,000 --> 00:06:37,000
and backward propagation, like some of the weights we will not be updating.

117
00:06:37,000 --> 00:06:39,000
Okay, why do we do that?

118
00:06:39,000 --> 00:06:41,000
So that our model does not overfit.

119
00:06:41,000 --> 00:06:43,000
Okay, so does not overfit.

120
00:06:44,000 --> 00:06:50,000
Then, uh, after training this particular model, uh, we will see the concept of.

121
00:06:50,000 --> 00:06:52,000
So this is forward propagation.

122
00:06:52,000 --> 00:06:54,000
We will go ahead and calculate the loss.

123
00:06:54,000 --> 00:06:56,000
We will use some kind of optimizers.

124
00:06:56,000 --> 00:06:57,000
Right.

125
00:06:57,000 --> 00:07:02,000
Everything will try to write this particular code with the help of Keras TensorFlow.

126
00:07:03,000 --> 00:07:04,000
Keras.

127
00:07:04,000 --> 00:07:05,000
TensorFlow.

128
00:07:05,000 --> 00:07:05,000
Okay.

129
00:07:05,000 --> 00:07:12,000
Now once the model is trained, uh, then the next step will be that how do I take this model and convert

130
00:07:12,000 --> 00:07:15,000
into some file format?

131
00:07:15,000 --> 00:07:20,000
Let's say I will be using some pickle file format or dot h5 file format.

132
00:07:20,000 --> 00:07:20,000
Okay.

133
00:07:20,000 --> 00:07:22,000
We'll talk about this file format.

134
00:07:22,000 --> 00:07:23,000
What exactly it is.

135
00:07:23,000 --> 00:07:28,000
Because if we really want to do the deployment we really need to take we need to convert this particular

136
00:07:28,000 --> 00:07:29,000
neural network.

137
00:07:29,000 --> 00:07:30,000
We need to save their weights.

138
00:07:30,000 --> 00:07:35,000
We need to convert them into a pickle format file or H5 format file, so that we can reuse this and

139
00:07:35,000 --> 00:07:37,000
deploy it in any environment that we want.

140
00:07:38,000 --> 00:07:45,000
After doing all these things, uh, we will go ahead and uh, further, we will use Streamlit.

141
00:07:46,000 --> 00:07:54,000
Streamlit to create our web app.

142
00:07:54,000 --> 00:07:54,000
Okay.

143
00:07:54,000 --> 00:07:59,000
And from this web app, we will integrate all our models.

144
00:07:59,000 --> 00:07:59,000
Okay.

145
00:08:00,000 --> 00:08:01,000
We'll integrate all our models.

146
00:08:01,000 --> 00:08:04,000
And we'll deploy this in the Streamlit cloud.

147
00:08:05,000 --> 00:08:07,000
So all these things are basically going to happen.

148
00:08:07,000 --> 00:08:08,000
Okay.

149
00:08:08,000 --> 00:08:12,000
So this is the overall things that we are specifically going to do in this particular project.

150
00:08:12,000 --> 00:08:14,000
It will be step by step.

151
00:08:14,000 --> 00:08:18,000
And, uh, how this neural network is basically created, how optimizer loss function, how dropout

152
00:08:18,000 --> 00:08:22,000
will be done, everything I will be discussing about it as we go ahead.

153
00:08:22,000 --> 00:08:22,000
Okay.

154
00:08:23,000 --> 00:08:29,000
So first thing first, uh, what I will do, I will go to my folder over here and I will just go ahead

155
00:08:29,000 --> 00:08:30,000
and open my VS code.

156
00:08:31,000 --> 00:08:36,000
Now as soon as I open my VS code, this is my VS code over here okay.

157
00:08:36,000 --> 00:08:37,000
So here you can see my file is there.

158
00:08:38,000 --> 00:08:39,000
Now quickly.

159
00:08:39,000 --> 00:08:45,000
Uh, as you all know, the first step, because I'm going to do this in my local, uh, and I, um,

160
00:08:45,000 --> 00:08:50,000
if you have a little bit powerful machine, like, let's say i5, i7 processor, you will be able to

161
00:08:50,000 --> 00:08:52,000
run this entire code in a faster way.

162
00:08:53,000 --> 00:09:00,000
Um, again, uh, obviously, when we see more complex projects in the future, we will not be using

163
00:09:00,000 --> 00:09:00,000
local machine.

164
00:09:00,000 --> 00:09:03,000
Instead, we will go ahead with Google Colab.

165
00:09:03,000 --> 00:09:03,000
Okay.

166
00:09:03,000 --> 00:09:08,000
but right now I think the data set that we have, I have also tried it to run in my local machine.

167
00:09:08,000 --> 00:09:10,000
Everything will be running.

168
00:09:10,000 --> 00:09:15,000
So I'll just give you a brief idea like how you can do that, uh, deep learning uh, project set up

169
00:09:15,000 --> 00:09:17,000
in your local machine also.

170
00:09:17,000 --> 00:09:22,000
Okay, so first of all, I will go ahead and open my terminal quickly.

171
00:09:22,000 --> 00:09:24,000
Let's go ahead and open my command prompt.

172
00:09:24,000 --> 00:09:25,000
Okay.

173
00:09:25,000 --> 00:09:26,000
Here.

174
00:09:26,000 --> 00:09:32,000
Uh, I'm just going to use this conda and I'll say, hey, Conda create minus p, v and v environment.

175
00:09:32,000 --> 00:09:37,000
And let's say I take python double equal to 3.11, okay.

176
00:09:37,000 --> 00:09:38,000
And I'll say yes.

177
00:09:39,000 --> 00:09:46,000
So this entire, uh, environment I'm actually creating and, uh, here, uh, once this environment

178
00:09:46,000 --> 00:09:49,000
gets created, I'm going to just create my requirement dot.

179
00:09:49,000 --> 00:09:55,000
TXT file Requirements dot txt file.

180
00:09:55,000 --> 00:10:03,000
Um, understand now uh, there are different uh versions of TensorFlow that have earlier come, but

181
00:10:03,000 --> 00:10:05,000
I'm just going to do with the recent one.

182
00:10:05,000 --> 00:10:10,000
The reason is very simple because now you have Keras integrated within TensorFlow.

183
00:10:10,000 --> 00:10:13,000
Before Keras was a separate library and TensorFlow was a separate library.

184
00:10:13,000 --> 00:10:17,000
Now Keras as an API has been integrated inside TensorFlow.

185
00:10:17,000 --> 00:10:23,000
So let us go ahead and write the first library that we are specifically going to use.

186
00:10:23,000 --> 00:10:24,000
Okay.

187
00:10:24,000 --> 00:10:28,000
And uh, again as I said, we are going to use the recent TensorFlow version.

188
00:10:28,000 --> 00:10:30,000
So I will just go ahead and write TensorFlow.

189
00:10:31,000 --> 00:10:33,000
Uh TensorFlow.

190
00:10:33,000 --> 00:10:38,000
Let's say that I will go ahead and use 2.1.50 okay.

191
00:10:38,000 --> 00:10:41,000
And I think this is the recent one that we are specifically going to use.

192
00:10:41,000 --> 00:10:44,000
And if any update comes, let's say you don't want to use this.

193
00:10:44,000 --> 00:10:49,000
Just remove this particular version and just remove it in this way, whichever will be the recent one

194
00:10:49,000 --> 00:10:50,000
that will get updated.

195
00:10:50,000 --> 00:10:56,000
But right now, since I have implemented this project with 2.1.50, you'll be able to see that it will

196
00:10:56,000 --> 00:10:56,000
work absolutely fine.

197
00:10:56,000 --> 00:11:00,000
Along with this, what I'm actually going to do, I'm going to use pandas.

198
00:11:00,000 --> 00:11:01,000
I'm going to use numpy.

199
00:11:02,000 --> 00:11:07,000
Along with this I will also use scikit learn because I'm going to use some of the feature engineering

200
00:11:07,000 --> 00:11:12,000
libraries or data transformation libraries that are available from scikit learn, uh, like standard

201
00:11:12,000 --> 00:11:13,000
scaler.

202
00:11:13,000 --> 00:11:18,000
Uh, you also have will convert that into a pickle file also.

203
00:11:18,000 --> 00:11:21,000
Then uh, we'll also go ahead and use this TensorBoard.

204
00:11:21,000 --> 00:11:25,000
I will talk about this TensorBoard, what exactly it is and all as we go ahead.

205
00:11:25,000 --> 00:11:29,000
Then we have this matplotlib for some plotting.

206
00:11:29,000 --> 00:11:32,000
And finally we'll also go and use this Streamlit library.

207
00:11:32,000 --> 00:11:35,000
So all these libraries we are going to specifically use it.

208
00:11:35,000 --> 00:11:39,000
Now let me quickly go ahead and activate my V and V environment.

209
00:11:39,000 --> 00:11:44,000
So I'll go ahead and write conda activate v and v okay.

210
00:11:44,000 --> 00:11:51,000
Uh and uh now from here I will go ahead and pip install minus our requirement dot txt.

211
00:11:52,000 --> 00:11:58,000
So uh now you can see that my installation of this entire libraries will happen.

212
00:11:58,000 --> 00:12:05,000
Uh, it will take some time because TensorFlow is also a big file and uh, it will download based on

213
00:12:05,000 --> 00:12:06,000
your internet speed.

214
00:12:06,000 --> 00:12:10,000
By default I'm just going to use TensorFlow, not with GPU, instead with CPU.

215
00:12:10,000 --> 00:12:16,000
As I said that if we are solving a larger problem statement, uh, CPU sometimes will not be sufficient.

216
00:12:16,000 --> 00:12:17,000
Okay.

217
00:12:17,000 --> 00:12:21,000
And based on that, uh, we'll try to further do this discussion okay.

218
00:12:21,000 --> 00:12:23,000
So let this installation take place.

219
00:12:23,000 --> 00:12:29,000
Uh, now in the next video we will start implementing our, uh, problem statement.

220
00:12:29,000 --> 00:12:31,000
And uh, we'll take the this particular data set.

221
00:12:31,000 --> 00:12:37,000
We'll read this data set and uh, we'll see step by step what all, um, you know, transformation techniques

222
00:12:37,000 --> 00:12:41,000
we are going to use and how we are going to create the and with the help of TensorFlow.

223
00:12:41,000 --> 00:12:44,000
So, yes, uh, I will see you all in the next video.

224
00:12:44,000 --> 00:12:45,000
Thank you.

