# Advance Machine Learning

- **Course:** 6103 - Advanced ML
- **Recorded:** 2026-10-10 09:26
- **Transcript:** 275 segments, 4632 words
- **Made by:** deepdml/faster-whisper-large-v3-turbo-ct2

---
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. recording is always on i had started no issue i think there may be the problem thing is there okay no issue i am telling okay recording is on right now okay it's running okay fine fine so yeah so we had created now the first thing that comes in your mind the first thing is the we need to assign the weight how we can assign the weight through the weight in slicer okay so we are having we had imported the random normal सबसे स्टार्टिं में you had seen the random normal and we had given the standard deviation is 0.02 you can remove this यदि यह भी दोगे then there may be the sum of

the weight is in sliced but we had given कि हमें standard deviation 0.02 हो ऐसा weight assign करो so that it is the little bit good thing okay now we are converted the input okay input में क्या है image का save गया and it is coming in the in underscore image okay so input layer के अंदर there will be the 28 cross 28 okay now there will be the flatten layer is there and in image तो in image में जो 28 cross 28 है उसको flatten कर दिया and it is stored in the sea तो क्या हो गया there will be the 784 cross 1 that are coming in the C okay now we had used now we had used the new C this is the previous C previous C will be the 784 cross 1 now we need to make up one hidden layer and this is the hidden layer okay this is the hidden layer so in the hidden layer we had used the dense because each and everything are connected okay and we had used the 16 neuron okay we had used the 16 neuron in this and we had used the relu activation function in every neuron okay we can fix the

every neuron can the reactive sorry relu activation function and the third one is the beta initializer or beta initializer conservate use kernel like this okay like this so we had created the first layer okay that will be the h1 layer after that we had used the dropout layer that is the 0.01 sorry 0.1 and this is now we had created so this is the first layer okay now dropout is just an optional step you can use the dropout or you will not okay so it's a recommended not the recommended thing it's the optional sorry it's it is not the necessary thing only the recommended thing is there you need to use the dropout it's the optionally step now a clear a hidden layer bana di this is like a one hidden layer when to use the dropout and when will not the i am saying whenever we are having the overfitting then we can use the dropout okay the recommended thing is this one okay so we had used it abhi sahi hum

na use kal di hai you can use okay yadi nahi bhi use karo ke then it is nothing like this is ko hatha ke bhi your work will be go okay kabh use karna hai during the overfitting only that is the recommended thing okay but right now humne check nahi kiya phir bhi humne just i am explaining this mein explain karra ho tumko isliye meinne putting all the things here this this is just like a example is there that's why i am putting here okay sir we can use any number of the neuron yes you can use any number but in the form of 2 to the power okay two to the power okay but you can use this is again just a recommendation then it is very much fine but you can use 20 we use it's up to you okay training high okay but at what layer we can be add drop out and how much percentage it is not it's a any any dropout you can put okay it's again trial and error thing okay it is not the anything you can use anywhere in uh apart from the input layer you can add

anywhere dropout dropout sari layer pe apply ho sakta apart from the input layer so what is the use of the dense layer dense layer ka use ye hai ki we need to connect each and every neuron with each and everything this is one kind of the dance yes the connector is savvy savvy savvy savvy like this this is the dense network okay this is the dense network that each neuron is connected with each thing okay the similar thing humane a core hidden layer one adi yes fully connected layer the fully connected layer is a one kind of the layer is there while the dense layer is also the same that is connected with each and everything training increase what the overfitting is the concern okay yeah now we had used another layer a clear 16 k1 i the same layer i had used the hidden layer 2 okay hidden layer 2 is of 32 okay now we are having the we had met the one more layer that will be the 64 now at the end we had used the output layer okay output layer is having

the 10 neuron this is the fixed thing okay this is the fixed thing at output layer we had used the softmax activation function okay while other we had used the relu okay so it is just the random thing but it's a recommended thing is there whenever we need to perform the classification we need to always use the softmax activation function because softmax activation function is performing well for the classification so in between so output layer will perform the classification that's why we are writing the softmax activation function over there okay so this is our complete architecture is there okay uh sir can we have a input or output across all the layer would you like to one sample point in each layer yes hundred percent ideal why and how we decided to have the three-tenth layer in the this but it's it is not the criteria i abhi bata raha anuja actually right now what i am did i i had made the three in the next model i tried the four i next

time i tried the two next time i tried the five it is like this hundred percent you will get the thing sir how we in a go how we are gonna make a trade-off between the overfitting underfitting that is a different question we'll just wait for this what is the kernel initializer kernel initializer is just for initialize the weight weight core randomly initialize the kernel initializer will use okay we can use the different activation function in the hidden layer yes you can what if you what if we use the sigmoid you can use the sigmoid also but sigmoid is not the recommended things for the classification it is the recommended thing for the binary classification not for the multi-class classification it's a recommendation yes you can use but okay yes it is done okay now we had created the model to our model case here the input layer then a hidden layer and this is the 16 neuron this is 32 this is the 64 neuron and at the output 10 neuron is

there it is looking like this it is looking like this okay now the in image the model model will do now we had performed the model okay because model is already in the keras we had imported okay now we need to give the in so this is the input and this is the output okay now we had used the model now model dot compile model dot compile method is used and here we had compiled the model and we had find out the loss is a categorical cross entropy while we had used the sgd optimizer then we had used the accuracy and we had written the model now we had created the model okay now we had created the model okay why we are increasing the number of neuron it's it's just like a random thing okay it is just like a random thing okay hum a se exponentially increase kate jayenge jitna jyadha neuron increase karenke utna feature extraction that's it. Okay, it is just like our human mind. It is like this. Now we have created the model. Okay, now you need to see. Okay, now we are

making the defined classifier and inside this there will be the 28 cross 28 cross one what is the meaning of one because it's a gray image that's why i am writing the one if it is the rgb image then we can write the three or we can see the model summary now this is the important thing that you need to understand the input layer may what is the output shape our output shape is just like 28 to 28 cross one and the first thing is the none what do you mean by the none it can take any number of the image okay and right now the parameter is zero now we had performed the flatten layer then flatten layer which will perform 28 x 28 x 1 so this is the 784 and none this none will indicate that you can take the any number of the image that's why we are writing the parameters zero now next time the dance will perform and dance will perform the none into none comma 16 because we have a 16 neuron now the this 784 is multiplying with the 16 why so

like this this is the 784 cross one or this is the 16 neuron okay here 16 neuron is there like this here 16 neuron each neuron is connected with this okay each neuron is connected with this so how many parameter is there here you can see the parameter there will be the 12 560 okay so what is one one is just the 28 cross 28 is the same okay that that is the row and column while one can be the gray scale because it is a gray scale that's why its channel is the one if it is the rgb image its channel is the three okay rgb okay some of the factor for the r some of the factor for the g okay just like this okay just like this this is the rgb but it is the gray scale image it's that's why its channel is always one so this is the 28 plus 28 every 28 plus 28 hota into three hota okay but we had used the gray scale that's why we are writing the one okay yes this is the question okay can you print the input that will go to each layer 100 percent i had given the

input input on the data that will be the five the image the input is looking like this yeah this type of five bana hua tha okay this type of five bana hua tha this is an input yeah convert hoga 28 cross 28 across one may like this kuch pixel value hoki and pixel value ko humne convert cut the zero to one can the zero point two zero point five zero point eight in starting so this is the input the random waiting slicer okay it is like this now the dropout okay now we had performed the dropout dropout make there will be the no combination is there now the next layer this is the again one layer okay that is the sixteen cross 32 then again drop out then again one layer that is 64 then again drop out then last layer is the 10 layer that will be the output layer so this is the so total parameter is 1586 now we had performed the training now we had performed the training so for the training there will be the fit method is

used okay we had created the model that model.fit and we had give the input x train reg what is the reg reg is the normalized data okay joe bhi hamne normalized data perform kiya tha that will be the reg and we had used we had converted the categorical data in the y-train concert data one hot encoding and we had performed the epoch what do you mean by the epoch the one forward propagation and one backward propagation is equal to the one epoch the yeh kitni bar hooga ten time and what is our best size best size is the 64 that means one time how much data will pass 64 data will pass after 10 iteration 10 iteration okay so what is the best size best size is just like how much data can be 64 data like this now this is the proper training okay this is the proper training and this proper training will going like this this is the 11.21 the first epoch pay our accuracy is the 11 percent second epoch third epoch fourth epoch like this so whatever

the model we had created it gives the only 11 percent 11 percent is not the big accuracy so right now okay got this particular point got this particular point we did the training or after the training after the 10 epoch our accuracy is only that 11.24 percent okay and 938 are the number of sample in the which where is 938 where is 938 there is nothing 938 like this okay 938 is nothing like this number of page or step in the uh where is 938 written okay okay sorry okay okay okay yeah 938 is uh total yeah total batch because whatever the total number of images is there it is breakdown in the 64 sorry for this yeah understand it this is the this so 938 batches total 938 batches is performing because one time 64 and total data whatever the total data is there divided by the 64 then the 938 will come okay but cannot be increase 100 percent ab increase cut them accuracy there are lots of thing at the end you will get

the 99 percent accuracy at the end you will get the 98 percent accuracy here you can see at the end you will get the 98 how you will increase the 98 i'll tell i am defining this particular okay how you will improve the accuracy i am taking the this particular okay so don't be confused that is a very rare okay that is a very bad thing now 11% is the very bad thing we need to do the more training we need to do the more training either we can remove the dropout or we need to do the more training yes so we need to go ahead and we need to add the we need to create the second model okay we need to use why the recording messages are coming okay just leave it okay so mk2 now we had created the second model okay now we had created the okay the x-trend regularizes defining during the normalization we had defined jahaan per normalization perform kiya hai na yes this one this is the x-trend reg okay this is the x-trend reg okay now we had prepared the first model and we are achieving only the

the 11% so 11% is the very bad thing कि हमने 9 digit दी वो classify करेगा 5 okay so it is the very bad model तो अब हम क्या करते है we need to prepare the another model हम क्या करते है उसमें we need to add the two more layer we need to add the two more layer 128 की layer add कर दो and 1 256 की layer add कर दो while all the other are the same okay yes you can see all the model are same all the model are same okay all the model are same only we had can we add this two layer a 128 neurons key and layer radical the end one 256 key 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 layer and we had added the new 128 neuron and new 256 neuron okay so what why should we change the model architecture instead of not checking the number yeah we will check epoch change change one by one I am telling each and everything okay it's just like yes it is also the gurdip is also telling the correct okay we need to change the architecture now we add this too

whatever the parameter जो parameter 15,000 पे था now our parameter is increased that will be the 71,000 now we had fitted the model now you can see again accuracy is not changing हमने वो second model को भी fit किया our accuracy is not changing our accuracy is same now again still the weight option is there now what we need to change yes now your point is coming yes we are making that we are increasing the epoch to joe humne model banaya hai usi pe we need to fit okay to humne epoch change kara so we are do the epoch 20 now you got after the 8th 9th epoch our accuracy is increasing and our accuracy is reached to the 85 okay and now our accuracy is moving to the 85 okay now 85 is also not the good choice according to us yes it is the major improvement yes we did the major improvement but 86 is again not a good choice okay yes we increased the epoch when it is still improving however we are changing the under fitting due to the insufficient yes

abhi you will get the thing right now i am this is the very interesting thing this is the very interesting thing you will see okay just wait for just one minute i am giving all the answer okay yes now we are adding one more layer okay one more layer abhi you had told ki yaha 20% epoch hua sorry 20 epoch hua then you will get the good accuracy thik hai okay now we had added the 256 ki echo layer ko add kar diya ye toh humara previous model tha we had added one more layer that is a 256 and we had run over the now we can see parameter increase we had increased the parameter now we are running on the 20 epoch whatever you said again your accuracy is dropped okay so it doesn't like this so this is the very interesting fact that you need to understand that higher increase is not a good option always the epoch increase is also not a good option, okay so this is just a trial and error that's why I am saying lots of

things to you, it is not the good option, we can increase the epoch until the accuracy is stopping so this is just like an understanding this is just like an understanding that you got, so whatever I am teaching I am not telling that I am showing you a very good model it's my understanding I am explaining my understanding ki always the layer increasing is not a good option I always the epoch increasing is not a good option so you need to build your in understanding from this particular because this is the educational thing always you are understanding or you are you are going for the accuracy high but I am NOT my concern is only to understand you people okay so yes this is now we got the 11% again now we did a model create again the bad choice we did the model same we did the model same now what we can change we had changed the optimizer only okay we had changed the optimizer so right now optimizer what optimizer we had used we had used

the atom okay now atom use kara now you will see your accuracy is starting from the first epoch here first epoch me kya raha tha 11 percent to jesai hum ne optimizer change kia your first epoch itself give the 78 71 percent and at the end you will get the 96 percent accuracy so you can think you can think what is the impact of the optimizer ki beth ka improvement during the back propagation kitana achse se improve ho ra hai and this all things are called as a hyper parameter tuning so you had created the model but you need to do the hyper parameter tuning so whatever things that you can change during the training that can call as an hyper parameter so you can change the epoch you can change the architecture you can change the optimizer okay so right now we are achieving the 96 percent okay now we can change key we need to check the is it overfit or not so test accuracy is the 96 so our training accuracy is 96 and our test accuracy is 96

now that our model is not over fitted okay now now we have changed the best size now our best size is 128 now we have changed the best size or best size 20 120 sorry 64-128 now you are this 938 are becoming the 469 now you can think your accuracy is still enhancing now your accuracy is 96.5 but little bit increase okay little bit increase now now we had added the another layer and now we had added the another layer that will be the 512 right now whenever we had added the layer but now we had added the 1512 layer and now we are running now we are running on the 64 batch okay now you can see your accuracy is enhancing 0.98 okay now your accuracy is enhancing to the 98 percent that means what i am trying to say from all this experiment okay what i am trying to say i am telling this particular that means our complete architecture is based on our trial and error method it is not always always 100 percent true ki hamaysa layer rate karne se accuracy enhance hoti hai it is not like this

hamaysa epoch badaane se accuracy enhance hoti hai it is not like this always optimizer change karne se accuracy enhance hoti it is not like this with the combination of all this we can go ahead and we can think yes definitely there will be the accuracy enhancement while we are doing the hit and try method that is all i want to tell okay with the incremental epoch it would be the situation that the accuracy yes hundred percent sometimes the accuracy is uh at the saturation level it will not change to stop and that is stopping technique is the called as an early stopping we can use the callback function okay we can use the callback function and callback function is used for early stopping this is the right choice but i am not telling this particular question i want to build your understanding that's why i am doing that particular thing okay sir essentially sometimes we can get the better accuracy while the using the 100 percent

the model can i run 100 percent you will learn in the column while upload you can take the download and you can upload on the column and you can run and you can try different different model when i get try karo okay you can do by copying the codes here if you are i am i am say this particular 500 i am giving this complete file okay is accuracy the good choice to decide yes this is one of one kind of the parameter after the accuracy precision recall f1 score or the binary cross entropy categorical cross entropy this all can be the choice okay so that's it from my side i had taken the enough thing okay i am uploading this okay right now I am uploading this okay in the left section you will definitely get this okay so you can take and you can explore this particular yes we can until and unless you can't build the understanding you need to explore each and everything okay right now I am telling you to use the brute force hundred percent brute force once you are understanding build then you

can think about just like yes 5 layer or 10 epoch it is like this okay after understanding after building your understanding you can go ahead with the some of the things you can neglect just say i am directly neglecting yes 20 epoch is also not giving the good thing i am running i am starting from the 50 epoch okay so it's just like understanding but that things you need to build that's why i am putting so much effort to understanding you because it will build your understanding then your understanding will never win okay because the accuracy of the mislead us sometimes yes hundred percent that's why we are saying that you can use the precision recall when there are lots of things so if possible please at the comment in the code every comment is written everywhere the comment is written you can see this is the comment okay everywhere the comment is written here everywhere the comment is written okay this is the perfect thing okay here everywhere comment is written you can read

and you can understand it is the very good lecture i am this is my favorite lecture this is my favorite topic the mlp is the one of the good thing okay very good thing if you build the understanding from there you can definitely reach to the very good level okay yeah so thank you all time is also very less uh due to the less time i am not giving you the 100 percent things to you but i am trying to give the 98 95 percent to you okay because there are lots of people is there lots of doubt is there there are lots of content is there so bear with this okay and you can ask you can ask that particular question in the next class also okay yeah thank you thank you thank you thank you thank you so much so one more thing that i want to ask how can i develop my understanding you need to build the various model you need to run the many code okay you will build your understanding hundred percent okay the good thing is that

that is the thing okay so I am sharing this in the on the Moodle kindly take and doing the thing okay so thank you all I am ending this particular class okay fine I'll tell this particular answer the Pytorch okay okay stop recording

