154 - Understanding the training and validation loss curves
Ғылым және технология
Loss curves contain a lot of information about training of an artificial neural network. This video goes through the interpretation of various loss curves generated using the Wisconsin breast cancer data set.
archive.ics.uci.edu/ml/datase...)
Code generated in the video can be downloaded from here:
github.com/bnsreenu/python_fo...
Пікірлер: 143
Thank you very much for the amazing video. This is one of the most important topic that no body talks about!!
Thank you for this helpful video. You are the best teacher!
You're the best! Very complex scenarios explained in simple way
This is outstanding. This is the first video to cover an actually useful process for developing a model from scratch in terms of arch decisions. Anyone else know of similar content?
Benefited immensely learning about the training and validation curves. Thank you!!
@DigitalSreeni
3 жыл бұрын
You're so welcome!
Excellent series that covers a lot of important concepts that many tutorials typically do not cover in great detail.
@DigitalSreeni
2 жыл бұрын
Glad you think so!
Thanks for sharing how to determine the loss curve. very useful and concise.
Thank you very much for the video, it is concise and covers a lot of cases for the learning curves. Exactly what i was looking for!
@DigitalSreeni
2 жыл бұрын
Great to hear!
How nicely explained! Thank you so much
I don't know how exactly to thank you. Simply amazing !!!
@DigitalSreeni
3 жыл бұрын
You're very welcome!
This video is so good. The ideas were clearly explained and shown through the graphs. The examples cover a lot of cases you might encounter! I will definitely recommend to others and rewatch this video if I am ever feeling confused. Thank you so much! You are a great teacher!
The explanation is so clear for my deeper understanding about underfitting and overfitting phenomenon. Thanks! It's really helpful!
@DigitalSreeni
2 жыл бұрын
You're very welcome!
Amazing explanation!!! Loved it. Thank you.
Thank you very much for the video. Really clear explanations and wonderful slides! :)
This was so helpful I was struggling to see the big picture here and now I feel much more equipped! Thanks
Thanks a lot this really help me a lot the way you explain small small things in between that really helps
Thank you so much sir. All of your videos really taught me a lot during my journey of completing my FYP!!!
@DigitalSreeni
2 жыл бұрын
Great to hear!
bowed down to you sir ! what a crystal clear explanation
@DigitalSreeni
3 жыл бұрын
You are welcome.
Beautifully explained
Perfectly Explained... I wish I get teacher like you.
@DigitalSreeni
3 жыл бұрын
Well, you have a teacher like me on KZread :)
Great! Very clear and concise, and potentially all pitfalls are well-explained! I would appreciate if you talk about learning rate, batch size and kernel size and their impact on training and validation loss curves. Many thanks!
Wow! Best video on this topic.
Clearly explained - much apprecitaed
Great video, as always amazingly explained!!
@DigitalSreeni
3 жыл бұрын
Thanks!
@IrfanKhan-oh7kb
2 жыл бұрын
@@DigitalSreeni Wisconsin breast cancer data set is not available
Great explanation! Thanks!
Excellent!! Very Well Explained!!
thank you again !! where ever i need y you're there ^_^
very clear and easy to understand video
@DigitalSreeni
5 ай бұрын
Glad you think so!
Thank you! This video was very helpful..
Very good an practical explanation. Yo have another subscriber.
your videos are great! thank u
Well explained the curves.
Thank you for your wonderful clips. Please also teach about epoch and batch size. Thank you
Very informative, didn't get bogged down in the code
This was too helpful.
Very useful video. Thanks a lot.
@DigitalSreeni
3 жыл бұрын
You are welcome
I learnt a lot, thank you!
Thanks a lot sir, for all these information..
@DigitalSreeni
3 жыл бұрын
Always welcome
finally I have understood, thanks a lot
very good video my friend, love you
Very useful , thanks
Awesome tutorial sir
@DigitalSreeni
3 жыл бұрын
Glad you liked it
very useful information, ty sir
thank you so much sir, for this video
Thanks, great video!
@DigitalSreeni
2 жыл бұрын
Glad you liked it!
thank you SIR !
Really awesome, keep going that way ;-)
@DigitalSreeni
3 жыл бұрын
Thanks, will do!
I bet you are a professor... Your explanations suffice the surface level understanding and enable to fundamentally understand the concepts... For sure, those concepts could be polished enough to convert them into knowledge after sufficient self-study... In-short, you are a "virtual professor" ♥
Thanks sir it's Amazing tutorial !!
@DigitalSreeni
3 жыл бұрын
Most welcome!
thank you very much
perfect I never seen before
Thank you
It is brilliant
@DigitalSreeni
2 жыл бұрын
Thanks
Thanks 🙏🏼
@DigitalSreeni
2 жыл бұрын
You’re welcome 😊
Thanks
Hi Sir. I have a questions regarding the loss. Which should we check the loss in normal practice? loss per epoch or loss per batch? thanks
Thank you for the informative video! For the splitting of the data, can we consider a stratified split to get a more representative train and test sample? i.e. X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size = 0.25, random_state = 42, stratify=Y)
@mostafaessam3994
Жыл бұрын
Hey Could elaborate more how to do stratify sampling ? If we have 9 units (engine data) and we take 6 of them to train the model and 3 of them to test the model Appriciate your reply.
Thank you! I was wondering what to do if train and validation converges at Epoch x (like a good fit at 26:40) and Loss doesn't decrease anymore for many more Epochs. Should we try adding epochs till it starts to overfit or stop learning at the first epochs having the lowest Loss?
@julianaELF1D
Жыл бұрын
Should have just stopped learning at the first lowest loss. This trick can be performed by keras early stopping... but you need to wait for 10 to 20 epochs to see that your model has absolutely gotten the optimal result (will not overfit and training and validation already nearly constant zero)...
Great video. Thanks for sharing. Is it possible to get zero as loss value? I noted on your graphics that the minimum value of loss 0.1. this value can be 0 ?
Hi, is there a way to train the same model multiple times (for example 10 times) using the same data. Also it would be great if you can make a video for increasing the breadth (filters eg. 8, 16, 32, 64) and the depth (layers eg. 3, 4, 5) and training them 10 times each and then may be take the mean of the say mean_squared_error and plot the bar graph of all the 12 combinations. If there is already a tutorial on this please share the link. Thanks in advance!
Thank you for the video. Don't you need to split the data first and then scale - so that test data is not leaked to the model?
Can you please make a video lecture on K-fold cross validation and evaluation on test datasets with example code. Please explain from scratch, how to split datasets and everything with example. thanks in advance. Your lectures are very helpful to learn. Great work.
@DigitalSreeni
2 жыл бұрын
Will try
Just a question after epoch 100 both the curve is just doesn’t do anything and it’s stable so what does it mean? Should we limit the epoch ? Is 100 epoch already good?
You mentioned a couple of times to keep changing the random_state in train/test splits and to choose the appropriate model based on their performance to each of these splits. But, doesn't this mean you are leaking information from your test set to train set? This way you'd choose your model while seeing the test set and this may not generalize to other unseen data. I haven't heard all your lectures but probably you are advising to include a separate validation set (train/validation/test) in your split. This would solve this problem and as much as trivial it might sound, it is a big problem in DL in my opinion. Very nice and informative video by the way, thank you!
@alonsomoran1646
5 ай бұрын
yes! I also wanted to mention this... we shouldn't mix validation and test data! Thank you for the video tho
Can you please provide the ppt of this lecture.
Thank you for such a rich and practical example. Which IDE are you using
@DigitalSreeni
3 жыл бұрын
Spyder IDE, part of Anaconda package.
@paulntalo1425
3 жыл бұрын
@@DigitalSreeni am two months into learning data science. I am using jupyter Notebook using pip3 and not anaconda. So is Anaconda always a better choice?
Thank you, Sir, can you please make a video on Mask RCNN.
Excellent explanation, just wondering which IDE you are using?
@sharmisthachakrabarti9880
Жыл бұрын
That's Spyder
Do you already make video about when to go up the layer or neuron?
@DigitalSreeni
2 жыл бұрын
kzread.info/dash/bejne/lKV2tKeNZ9fImbQ.html
So what is the connection between loss and accuracy.. actually i didn't know how to explain it properly. and then i wanna ask something. i had descent accuracy at 75% and validation at 71%, but my loss is also high, accuracy at 66% and validation at 75%, is that means that my training model isn't good enough?
thank you so much.as said training accuracy is higher than validation accuracy, but reason why you get validation accuracy higher than training accuracy. If it is so, how to correct it. Thanks in advance
If I have a model that has only one dense layer and it immidiately over fits, does it mean that the data is unrepresentative? The trainning loss goes down and val loss goes up immidiately. Sorry for my english.
Hi there. After training random foreset regressor on data I got the following scores: model.score(X_train,y_train) 0.88 model.score(X_test,y_test) 0.11 How can we intetpret this result ? Thank y
Thank you very much for delivering very detailed and informative videos. I have a doubt from last good fit slide. I understand that the length of training loss should be always greater than validation loss. However, sometimes I see that with some parameter changes such as validation split or batch size the training and validation loss curves toggles. So, training loss curve become shorter than validation loss curve. Could you please hint me what mistake I am doing? If anyone can clear my doubt it would be highly appreciated too. Thanks once again.
@DigitalSreeni
2 жыл бұрын
I am not sure what you mean by training curves being shorter than validation curves. They both should be of the same length as the x-axis represents epoch number and you'd get some values for training / validation for each epoch.
@satinathdebnath5333
2 жыл бұрын
@@DigitalSreeni I meant to say training loss curve and validation loss curve. Do they need to have same length on the graph or Training loss curve is usually longer than validation loss curve. From online, I see that validation loss curve tip start after sometime from the start of Training loss curve.
what will be the difference between reshuffling and changing random_state
Hello sir how to split the data into 3 dataset pls I need that code could u refers to me ...thanks so much
Which among those plots represent a curve with noise?
Nice video. I have doubt .. I'm working on a cnn model... Should I use training and testing dataset or training, validation and testing dataset?? I'm waiting for your ans
@DigitalSreeni
3 жыл бұрын
I divide my data into training, validation, and testing. I use training and validation during training where I track the loss curves and I use testing data to verify accuracy after the training process.
@389_kavetiupender2
3 жыл бұрын
Thanks alot sir for quick and clear reply.....
Sir please add tutorials on interpretable machine learning technique s
hello sir, sir my training shows only "accuracy and loss" after each step, i want it to show validation loss and validation accuracy after each STEP, can u please help me?
what it show i got training accuracy of 1.0 and testing accuracy of 0.99 is it good or correct
@DigitalSreeni
3 жыл бұрын
It shows that you are getting awesome results :)
please make a tutorial about transformers for image regression tasks.
Can you state how draw fid metric curve, i know the equation and i can get number score but i cant draw it😢
So if the validation and training accuracy are almost same .... let's say 62% and don't improve as the training epochs increases. What does that represent? I assumed having validation and training accuracy the same is good but the fact that the accuracy is low like 62% means model doesn't have much to learn? How to improve that?
WHen running this Fit with early stopping and model checkpoint to save the best models. from keras.callbacks import EarlyStopping, ModelCheckpoint es = EarlyStopping(monitor='val_loss', mode='min', verbose=1, patience=50) mc = ModelCheckpoint('models/model-{epoch:03d}-{accuracy:03f}-{val_accuracy:03f}.h5', monitor='val_loss', mode='min', ver... I am obtaining an error eyError: 'Failed to format this callback filepath: "models/model-{epoch:03d}-{accuracy:03f}-{val_accuracy:03f}.h5". Reason: \'accuracy\'' any idea why?
@DigitalSreeni
2 жыл бұрын
Try replacing val_accuracy with val_acc and accuracy with acc. I wonder if you are using different names in your metrics and other locations.
what if the number of trains Found 1896 images belonging to 12 classes. test Found 528 images belonging to 12 classes. and validate Found 276 images belonging to 12 classes. what is the epoch, batch size and patience so that the training & val accuracy and Training and val loss plot graphs match and are close together?
Good morning sir. I am a research scholar and developing a ANN model. I am using four variables=Y=fx1,x2,x3... Twenty years of long panel data with 24 regions. I am getting problem to select weight and nodes to get training and validation for a good model. How to much weight and nodes should i assign to get a good model? kindly advice me. Thank You sir.....
when i used your code i have received this error " Input 0 of layer sequential is incompatible with the layer: expected axis -1 of input shape to have value 30 but received input with shape (None, 7)" if you can help me please
@emadqalaja246
2 жыл бұрын
history = model.fit(X_train, y_train ,verbose=1, epochs=50, batch_size=64, validation_data=(X_test, y_test)) in this section
Sir I need cascade of two pre-trained deep learning model code plz help me
my validation loss is very high and validation accuracy less than training accuracy by 20% but my dataset is small 2164 sentence in Bi-LSTM text classification please help if you are ok
@DigitalSreeni
3 жыл бұрын
For small datasets you will have smaller validation data. That means the validation curves will look a bit bumpy and the accuracy will be lower than training data. This is quite common. Try increasing the amount of validation data. If that doesn't help you need to change the model and try. May be no model can help and you need to acquire more data. Deep learning is great but cannot do miracles, especially for limited data.
Wisconsin breast cancer data set is not available
Can Loss's value drop to zero?
@DigitalSreeni
2 жыл бұрын
Loss functions normally minimize a value to zero. In such loss functions, you will get zero loss if the model perfectly fits to the training data. This almost never happens. You will see a very small value but not zero.
hay :i got this - loss: 0.6026 - accuracy: 0.8960 loss: 1.1142 - accuracy: 0.7748 ist this overfitting?
@DigitalSreeni
3 жыл бұрын
How can you tell if it is overfitting by looking at loss and accuracy at one data point?
@abdulbareehussein787
3 жыл бұрын
@@DigitalSreeni i mean , if we have Acuuracy 0.90 and loss is 1.8, is this then an Overfitting?
No mention of loss rate? xD
my validation accuracy is 98%. Submitting a real image to it... Not getting 98% accuracy.
Understanding nothing from here
Thank you
Thanks
Thank you