[00:00:02] We are fitting the 28 x 28 in this. Recording has started. Why it is coming? It is already started. Yeah, I don't know what happened. Okay. So yeah, image shape is 28 x 28. Okay. Why the recording has stopped? Message are coming. Just wait. I need to check. Yes, it is started from my side. I don't know what happened. Okay. No issue. I am again sharing the thing. [00:00:42] recording is always on i had started no issue i think there may be the problem thing is there [00:00:48] okay no issue i am telling okay recording is on right now okay it's running okay fine fine [00:00:56] so yeah so we had created now the first thing that comes in your mind [00:01:02] the first thing is the we need to assign the weight how we can assign the weight [00:01:06] through the weight in slicer okay so we are having we had imported the random normal [00:01:11] सबसे स्टार्टिं में you had seen the random normal and we had given the standard [00:01:16] deviation is 0.02 you can remove this यदि यह भी दोगे then there may be the sum of [00:01:22] the weight is in sliced but we had given कि हमें standard deviation 0.02 हो ऐसा weight [00:01:28] assign करो so that it is the little bit good thing okay now we are converted the input okay [00:01:35] input में क्या है image का save गया and it is coming in the in underscore image [00:01:41] okay so input layer के अंदर there will be the 28 cross 28 okay now there will be the [00:01:48] flatten layer is there and in image तो in image में जो 28 cross 28 है उसको [00:01:54] flatten कर दिया and it is stored in the sea तो क्या हो गया there will be the [00:01:58] 784 cross 1 that are coming in the C okay now we had used now we had used the new C this is the [00:02:07] previous C previous C will be the 784 cross 1 now we need to make up one hidden layer and this is [00:02:13] the hidden layer okay this is the hidden layer so in the hidden layer we had used the dense because [00:02:19] each and everything are connected okay and we had used the 16 neuron okay we had used the 16 neuron [00:02:26] in this and we had used the relu activation function in every neuron okay we can fix the [00:02:33] every neuron can the reactive sorry relu activation function and the third one is the [00:02:40] beta initializer or beta initializer conservate use kernel like this okay like this so we [00:02:45] had created the first layer okay that will be the h1 layer after that we had used the [00:02:51] dropout layer that is the 0.01 sorry 0.1 and this is now we had created so this is the first layer [00:02:59] okay now dropout is just an optional step you can use the dropout or you will not okay [00:03:06] so it's a recommended not the recommended thing it's the optional sorry it's it is not the [00:03:13] necessary thing only the recommended thing is there you need to use the dropout it's the [00:03:19] optionally step now a clear a hidden layer bana di this is like a one hidden layer when to use [00:03:25] the dropout and when will not the i am saying whenever we are having the overfitting then we [00:03:31] can use the dropout okay the recommended thing is this one okay so we had used it abhi sahi hum [00:03:40] na use kal di hai you can use okay yadi nahi bhi use karo ke then it is nothing like this is ko [00:03:46] hatha ke bhi your work will be go okay kabh use karna hai during the overfitting only [00:03:51] that is the recommended thing okay but right now humne check nahi kiya phir bhi humne just [00:03:57] i am explaining this mein explain karra ho tumko isliye meinne putting all the things [00:04:01] here this this is just like a example is there that's why i am putting here okay sir we can [00:04:06] use any number of the neuron yes you can use any number but in the form of 2 to the power [00:04:12] okay two to the power okay but you can use this is again just a recommendation [00:04:19] then it is very much fine but you can use 20 we use it's up to you okay [00:04:27] training high okay but at what layer we can be add drop out and how much [00:04:36] percentage it is not it's a any any dropout you can put okay it's again trial and error thing [00:04:44] okay it is not the anything you can use anywhere in uh apart from the input layer you can add [00:04:51] anywhere dropout dropout sari layer pe apply ho sakta apart from the input layer so what is the [00:04:57] use of the dense layer dense layer ka use ye hai ki we need to connect each and every neuron with [00:05:03] each and everything this is one kind of the dance yes the connector is savvy savvy savvy savvy like [00:05:10] this this is the dense network okay this is the dense network that each neuron is connected with [00:05:15] each thing okay the similar thing humane a core hidden layer one adi yes fully connected layer [00:05:23] the fully connected layer is a one kind of the layer is there while the dense layer is also the [00:05:29] same that is connected with each and everything training increase what the overfitting is the [00:05:34] concern okay yeah now we had used another layer a clear 16 k1 i the same layer i had used the [00:05:43] hidden layer 2 okay hidden layer 2 is of 32 okay now we are having the we had met the one more [00:05:50] layer that will be the 64 now at the end we had used the output layer okay output layer is having [00:05:56] the 10 neuron this is the fixed thing okay this is the fixed thing at output layer we had used the [00:06:02] softmax activation function okay while other we had used the relu okay so it is just the random [00:06:10] thing but it's a recommended thing is there whenever we need to perform the classification [00:06:16] we need to always use the softmax activation function because softmax activation function is [00:06:21] performing well for the classification so in between so output layer will perform the classification [00:06:28] that's why we are writing the softmax activation function over there okay so this is our complete [00:06:35] architecture is there okay uh sir can we have a input or output across all the layer would you [00:06:43] like to one sample point in each layer yes hundred percent ideal why and how we decided to have the [00:06:49] three-tenth layer in the this but it's it is not the criteria i abhi bata raha anuja [00:06:57] actually right now what i am did i i had made the three in the next model i tried the four i next [00:07:05] time i tried the two next time i tried the five it is like this hundred percent you will get the [00:07:10] thing sir how we in a go how we are gonna make a trade-off between the overfitting underfitting [00:07:16] that is a different question we'll just wait for this what is the kernel initializer kernel [00:07:20] initializer is just for initialize the weight weight core randomly initialize the kernel [00:07:26] initializer will use okay we can use the different activation function in the hidden layer yes you [00:07:32] can what if you what if we use the sigmoid you can use the sigmoid also but sigmoid is [00:07:39] not the recommended things for the classification it is the recommended thing for the binary [00:07:44] classification not for the multi-class classification it's a recommendation yes you can use but [00:07:49] okay yes it is done okay now we had created the model to our model case [00:07:55] here the input layer then a hidden layer [00:08:00] and this is the 16 neuron this is 32 this is the 64 neuron and at the output 10 neuron is [00:08:08] there it is looking like this it is looking like this okay now [00:08:14] the in image the model model will do now we had performed the model okay because model is already [00:08:21] in the keras we had imported okay now we need to give the in so this is the input and this is the [00:08:28] output okay now we had used the model now model dot compile model dot compile method is used [00:08:36] and here we had compiled the model and we had find out the loss is a categorical cross entropy [00:08:42] while we had used the sgd optimizer then we had used the accuracy and we had written the model [00:08:49] now we had created the model okay now we had created the model okay why we are increasing [00:08:56] the number of neuron it's it's just like a random thing okay it is just like a random thing okay [00:09:03] hum a se exponentially increase kate jayenge jitna jyadha neuron increase karenke utna [00:09:08] feature extraction that's it. Okay, it is just like our human mind. [00:09:20] It is like this. Now we have created the model. Okay, now you need to see. Okay, now we are [00:09:34] making the defined classifier and inside this there will be the 28 cross 28 cross one what is [00:09:40] the meaning of one because it's a gray image that's why i am writing the one if it is the rgb image [00:09:45] then we can write the three or we can see the model summary now this is the important thing [00:09:51] that you need to understand the input layer may what is the output shape our output shape is just [00:09:57] like 28 to 28 cross one and the first thing is the none what do you mean by the none it can take [00:10:03] any number of the image okay and right now the parameter is zero now we had performed the [00:10:09] flatten layer then flatten layer which will perform 28 x 28 x 1 so this is the 784 and none [00:10:16] this none will indicate that you can take the any number of the image that's why we are writing the [00:10:22] parameters zero now next time the dance will perform and dance will perform the none into [00:10:28] none comma 16 because we have a 16 neuron now the this 784 is multiplying with the 16 why so [00:10:38] like this this is the 784 cross one or this is the 16 neuron okay here 16 neuron is there like [00:10:48] this here 16 neuron each neuron is connected with this okay each neuron is connected with this so [00:10:55] how many parameter is there here you can see the parameter there will be the 12 560 okay so what [00:11:03] is one one is just the 28 cross 28 is the same okay that that is the row and column while one [00:11:11] can be the gray scale because it is a gray scale that's why its channel is the one if it is the [00:11:17] rgb image its channel is the three okay rgb okay some of the factor for the r some of the factor [00:11:25] for the g okay just like this okay just like this this is the rgb but it is the gray scale image [00:11:33] it's that's why its channel is always one so this is the 28 plus 28 every 28 plus 28 hota into [00:11:40] three hota okay but we had used the gray scale that's why we are writing the one okay yes this [00:11:46] is the question okay can you print the input that will go to each layer 100 percent i had given the [00:11:53] input input on the data that will be the five the image the input is looking like this yeah this type [00:12:03] of five bana hua tha okay this type of five bana hua tha this is an input yeah convert hoga 28 [00:12:10] cross 28 across one may like this kuch pixel value hoki and pixel value ko humne convert [00:12:16] cut the zero to one can the zero point two zero point five zero point eight [00:12:20] in starting so this is the input the random waiting slicer okay it is like this now the [00:12:32] dropout okay now we had performed the dropout dropout make there will be the no combination [00:12:37] is there now the next layer this is the again one layer okay that is the sixteen cross 32 [00:12:44] then again drop out then again one layer that is 64 then again drop out then last layer is the 10 [00:12:52] layer that will be the output layer so this is the so total parameter is 1586 now we had performed [00:12:58] the training now we had performed the training so for the training there will be the fit method is [00:13:04] used okay we had created the model that model.fit and we had give the input x train reg what is the [00:13:13] reg reg is the normalized data okay joe bhi hamne normalized data perform kiya tha that will be the [00:13:21] reg and we had used we had converted the categorical data in the y-train concert data one hot encoding [00:13:28] and we had performed the epoch what do you mean by the epoch the one forward propagation and one [00:13:34] backward propagation is equal to the one epoch the yeh kitni bar hooga ten time and what is our [00:13:41] best size best size is the 64 that means one time how much data will pass 64 data will pass [00:13:48] after 10 iteration 10 iteration okay so what is the best size best size is just like [00:13:55] how much data can be 64 data like this now this is the proper training okay this is the proper [00:14:03] training and this proper training will going like this this is the 11.21 the first epoch [00:14:11] pay our accuracy is the 11 percent second epoch third epoch fourth epoch like this so whatever [00:14:17] the model we had created it gives the only 11 percent 11 percent is not the big accuracy [00:14:28] so right now okay got this particular point got this particular point we did the training [00:14:35] or after the training after the 10 epoch our accuracy is only that 11.24 percent okay and [00:14:42] 938 are the number of sample in the which where is 938 where is 938 there is nothing 938 like this [00:14:52] okay 938 is nothing like this number of page or step in the uh where is 938 written okay okay [00:15:01] sorry okay okay okay yeah 938 is uh total yeah total batch because whatever the total number [00:15:08] of images is there it is breakdown in the 64 sorry for this yeah understand it this is the [00:15:14] this so 938 batches total 938 batches is performing because one time 64 and total data [00:15:21] whatever the total data is there divided by the 64 then the 938 will come okay but cannot be [00:15:28] increase 100 percent ab increase cut them accuracy there are lots of thing at the end you will get [00:15:34] the 99 percent accuracy at the end you will get the 98 percent accuracy here you can see at the [00:15:40] end you will get the 98 how you will increase the 98 i'll tell i am defining this particular [00:15:46] okay how you will improve the accuracy i am taking the this particular okay so don't be confused [00:15:52] that is a very rare okay that is a very bad thing now 11% is the very bad thing [00:16:00] we need to do the more training we need to do the more training either we can remove the dropout or [00:16:06] we need to do the more training yes so we need to go ahead and we need to add the we need to create [00:16:13] the second model okay we need to use why the recording messages are coming okay just leave [00:16:21] it okay so mk2 now we had created the second model okay now we had created the okay the [00:16:29] x-trend regularizes defining during the normalization we had defined [00:16:34] jahaan per normalization perform kiya hai na yes this one this is the x-trend reg okay [00:16:41] this is the x-trend reg okay now we had prepared the first model and we are achieving only the [00:16:48] the 11% so 11% is the very bad thing कि हमने 9 digit दी वो classify करेगा 5 okay so it [00:16:55] is the very bad model तो अब हम क्या करते है we need to prepare the another model हम [00:17:00] क्या करते है उसमें we need to add the two more layer we need to add the two more [00:17:04] layer 128 की layer add कर दो and 1 256 की layer add कर दो while all the other are the [00:17:11] same okay yes you can see all the model are same all the model are same okay all the model are same [00:17:19] only we had can we add this two layer a 128 neurons key and layer radical the end one 256 key [00:17:27] abhi tak hum ne kya kiya tha 32 x 16 key at kari thi a 32 key x 64 key to we had removed the 16 [00:17:34] layer and we had added the new 128 neuron and new 256 neuron okay so what why should we change the [00:17:46] model architecture instead of not checking the number yeah we will check epoch change [00:17:51] change one by one I am telling each and everything okay it's just like yes it is also the [00:18:01] gurdip is also telling the correct okay we need to change the architecture now we add this too [00:18:19] whatever the parameter [00:18:20] जो parameter 15,000 पे था [00:18:22] now our parameter is increased [00:18:24] that will be the 71,000 [00:18:26] now we had fitted the model [00:18:28] now you can see [00:18:30] again accuracy is not changing [00:18:33] हमने वो second model [00:18:34] को भी fit किया [00:18:35] our accuracy is not changing [00:18:37] our accuracy is same [00:18:39] now again still the weight option [00:18:42] is there now what we need to change [00:18:44] yes now your point is coming yes we are making that we are increasing the epoch [00:18:50] to joe humne model banaya hai usi pe we need to fit okay to humne epoch change kara [00:18:56] so we are do the epoch 20 now you got after the 8th 9th epoch our accuracy is increasing [00:19:05] and our accuracy is reached to the 85 okay and now our accuracy is moving to the 85 okay [00:19:14] now 85 is also not the good choice according to us yes it is the major improvement yes we did the [00:19:24] major improvement but 86 is again not a good choice okay yes we increased the epoch when it [00:19:31] is still improving however we are changing the under fitting due to the insufficient yes [00:19:36] abhi you will get the thing right now i am this is the very interesting thing this is the very [00:19:41] interesting thing you will see okay just wait for just one minute i am giving all the answer [00:19:47] okay yes now we are adding one more layer okay one more layer abhi you had told ki yaha 20% [00:19:56] epoch hua sorry 20 epoch hua then you will get the good accuracy thik hai okay now we [00:20:02] had added the 256 ki echo layer ko add kar diya ye toh humara previous model tha we had [00:20:08] added one more layer that is a 256 and we had run over the now we can see [00:20:14] parameter increase we had increased the parameter now we are running on the 20 [00:20:20] epoch whatever you said again your accuracy is dropped okay so it doesn't [00:20:26] like this so this is the very interesting fact that you need to [00:20:29] understand that higher increase is not a good option [00:20:34] always the epoch increase [00:20:36] is also not [00:20:39] a good option, okay [00:20:40] so this is just a trial and error [00:20:43] that's why I am saying lots of [00:20:45] things to you, it is not [00:20:47] the good option, we can increase [00:20:49] the epoch until the accuracy is stopping [00:20:50] so this is just like an understanding [00:20:53] this is just like an understanding [00:20:54] that you got, so [00:20:56] whatever I am teaching [00:20:59] I am not telling [00:21:00] that I am showing you a very good model [00:21:03] it's my understanding I am explaining my understanding ki always the layer [00:21:09] increasing is not a good option I always the epoch increasing is not a good [00:21:14] option so you need to build your in understanding from this particular [00:21:18] because this is the educational thing [00:21:21] always you are understanding or you are you are going for the [00:21:29] accuracy high but I am NOT my concern is only to understand you people okay so [00:21:39] yes this is now we got the 11% again now we did a model create again the bad choice [00:21:48] we did the model same we did the model same now what we can change we had changed the optimizer only [00:22:07] okay we had changed the optimizer so right now optimizer what optimizer we had used we had used [00:22:16] the atom okay now atom use kara now you will see your accuracy is starting from the first epoch [00:22:24] here first epoch me kya raha tha 11 percent to jesai hum ne optimizer change kia your first epoch [00:22:33] itself give the 78 71 percent and at the end you will get the 96 percent accuracy so you can think [00:22:41] you can think what is the impact of the optimizer ki beth ka improvement during the back propagation [00:22:47] kitana achse se improve ho ra hai and this all things are called as a hyper parameter tuning [00:22:53] so you had created the model but you need to do the hyper parameter tuning so whatever things [00:23:00] that you can change during the training that can call as an hyper parameter so you can change the [00:23:05] epoch you can change the architecture you can change the optimizer okay so right now we are [00:23:12] achieving the 96 percent okay now we can change key we need to check the is it overfit or not [00:23:19] so test accuracy is the 96 so our training accuracy is 96 and our test accuracy is 96 [00:23:29] now that our model is not over fitted okay now now we have changed the best size now our best [00:23:39] size is 128 now we have changed the best size or best size 20 120 sorry 64-128 now you are [00:23:52] this 938 are becoming the 469 now you can think your accuracy is still enhancing now your [00:24:00] accuracy is 96.5 but little bit increase okay little bit increase now now we had added the [00:24:09] another layer and now we had added the another layer that will be the 512 [00:24:14] right now whenever we had added the layer but now we had added the 1512 layer and now we are running [00:24:29] now we are running on the 64 batch okay now you can see your accuracy is enhancing [00:24:37] 0.98 okay now your accuracy is enhancing to the 98 percent that means what i am trying to say from [00:24:45] all this experiment okay what i am trying to say i am telling this particular that means [00:24:51] our complete architecture is based on our trial and error method it is not always always 100 [00:24:58] percent true ki hamaysa layer rate karne se accuracy enhance hoti hai it is not like this [00:25:04] hamaysa epoch badaane se accuracy enhance hoti hai it is not like this always optimizer change [00:25:09] karne se accuracy enhance hoti it is not like this with the combination of all this we can go [00:25:16] ahead and we can think yes definitely there will be the accuracy enhancement while we are doing [00:25:22] the hit and try method that is all i want to tell okay with the incremental epoch it would be the [00:25:28] situation that the accuracy yes hundred percent sometimes the accuracy is uh at the saturation [00:25:34] level it will not change to stop and that is stopping technique is the called as an [00:25:41] early stopping we can use the callback function okay we can use the callback function and callback [00:25:48] function is used for early stopping this is the right choice but i am not telling this particular [00:25:56] question i want to build your understanding that's why i am doing that particular thing [00:26:02] okay sir essentially sometimes we can get the better accuracy while the using the 100 percent [00:26:08] the model can i run 100 percent you will learn in the column while upload you can take the [00:26:13] download and you can upload on the column and you can run and you can try different different [00:26:18] model when i get try karo okay you can do by copying the codes here if you are i am i am [00:26:23] say this particular 500 i am giving this complete file okay is accuracy the good choice to decide [00:26:30] yes this is one of one kind of the parameter after the accuracy precision recall f1 score [00:26:38] or the binary cross entropy categorical cross entropy this all can be the choice okay [00:26:47] so that's it from my side i had taken the enough thing okay i am uploading this [00:26:53] okay right now I am uploading this okay in the left section you will definitely get this okay [00:27:01] so you can take and you can explore this particular yes we can until and unless you [00:27:09] can't build the understanding you need to explore each and everything okay right now I am telling [00:27:15] you to use the brute force hundred percent brute force once you are understanding build then you [00:27:21] can think about just like yes 5 layer or 10 epoch it is like this okay [00:27:32] after understanding after building your understanding you can go ahead with the [00:27:37] some of the things you can neglect just say i am directly neglecting yes 20 epoch is also not [00:27:43] giving the good thing i am running i am starting from the 50 epoch okay so it's just like [00:27:50] understanding but that things you need to build that's why i am putting so much effort to [00:27:55] understanding you because it will build your understanding then your understanding will never [00:28:05] win okay because the accuracy of the mislead us sometimes yes hundred percent that's why we are [00:28:10] saying that you can use the precision recall when there are lots of things so if possible please [00:28:15] at the comment in the code every comment is written everywhere the comment is written you can [00:28:22] see this is the comment okay everywhere the comment is written here everywhere the comment [00:28:30] is written okay this is the perfect thing okay here everywhere comment is written you can read [00:28:38] and you can understand it is the very good lecture i am this is my favorite lecture this is my [00:28:44] favorite topic the mlp is the one of the good thing okay very good thing if you build the [00:28:49] understanding from there you can definitely reach to the very good level okay yeah so thank you all [00:28:59] time is also very less uh due to the less time i am not giving you the 100 percent things to you [00:29:06] but i am trying to give the 98 95 percent to you okay because there are lots of people is there [00:29:12] lots of doubt is there there are lots of content is there so bear with this okay and you can ask [00:29:18] you can ask that particular question in the next class also okay yeah thank you thank you thank you [00:29:24] thank you thank you so much so one more thing that i want to ask how can i develop my understanding [00:29:29] you need to build the various model you need to run the many code okay [00:29:34] you will build your understanding hundred percent okay the good thing is that [00:29:42] that is the thing okay so I am sharing this in the on the Moodle kindly take and doing the thing [00:29:52] okay so thank you all I am ending this particular class okay fine I'll tell this particular answer [00:30:04] the Pytorch [00:30:06] okay [00:30:07] okay stop recording