## Model Analysis – Deep Learning and Neural Networks with Python and Pytorch p.8

Welcome to part 8 of the deep learning with Pytorch series. In this tutorial, we’ll be covering how to do analysis of our model, at least at a basic level, along with honing in more on our training loop and code.

Text-based tutorial and sample code: https://pythonprogramming.net/analysis-visualization-deep-learning-neural-network-pytorch/

Linode Cloud GPUs \$20 credit: https://linode.com/sentdex

Discord: https://discord.gg/sentdex
Support the content: https://pythonprogramming.net/support-donate/
Instagram: https://instagram.com/sentdex
Twitch: https://www.twitch.tv/sentdex

#pytorch #python #deeplearning

Source

### Comment List

• sentdex
November 22, 2020

A simple way to smooth the accuracy and loss graphs using pandas exp weighted moving avg:

df['train_acc_mva'] = df['train_acc'].ewm(alpha=.02).mean() # exponential weighted moving average

df['test_acc_mva'] = df['test_acc'].ewm(alpha=.02).mean()

df['train_loss_mva'] = df['train_loss'].ewm(alpha=.02).mean()

df['test_loss_mva'] = df['test_loss'].ewm(alpha=.02).mean()

Then plot using pandas:
df.plot(x='batch_ind', y=['train_acc_mva', 'test_acc_mva'], figsize=(8,4))

plt.ylabel("Accuracy")
df.plot(x='batch_ind', y=['train_loss_mva', 'test_loss_mva'], figsize=(8,4))

plt.ylabel("Loss")

• sentdex
November 22, 2020

Man, please continue this series 🙁

• sentdex
November 22, 2020

NOTE: the "if i % 10 == 0" is not only true for every 10th step because our batch size is 100, so it's actually true EVERY STEP. That's why it takes so much longer, what we actually intended to avoid. Instead you could say: "if i % 9 == 0" beacause now it will only calculate it every 10th step! (note that range(0, len(train_X), BATCH_SIZE) will output 0, 100, 200 etc for i, so if i = 900 it's the 10th step)

• sentdex
November 22, 2020

Really great tutorials. So much better than the pytorch docs! Thanks.

• sentdex
November 22, 2020

ROLL TIDE ROLL didn't know you were a BAMA fan!!

• sentdex
November 22, 2020

What is the negative time in the plot? We are plotting time vs acc or loss. Why do we get plot for negative time less than 0??

• sentdex
November 22, 2020

Hello nice job! Would be nice if u continued with this series

• sentdex
November 22, 2020

94 комментария и ни одного на русском

• sentdex
November 22, 2020

Will you make more videos about pytioch?

• sentdex
November 22, 2020

The proposed random is not equally distributed.
The start and end-range will not be used as often as the middle part wich can be selected both by start as well as by the end.
For size 2 on a len of 4, both 0 and 3 are used once while 1 and 2 are used twice.
0 1 2 3:
XX
XX
XX
1,2,2,1
For size 3 and len 5, indexes 0 and 4 are only used once, while 2 is used all 3 times.
0 1 2 3 4:
XXX
XXX
XXX
1,2,3,2,1
Then again I understand that the random was not the main part of the video.

• sentdex
November 22, 2020

Thanks man.

• sentdex
November 22, 2020

Does it mean, that if we would train the same model with much bigger data that it would not overfit? Is it possible no mater how long the training takes that a model would not over fit?

• sentdex
November 22, 2020

Your series is amazing ❤ can you do RNN with text generation in PyTorch?

• sentdex
November 22, 2020

Yeah you did the same mistake where you update after each example rather than after each batch. In this code, the additional iteration over the batch is actually pointless.

• sentdex
November 22, 2020

Thanks for the series man! But i think we got one thing missing, how to properly save the model for using it later, or continue with the training after a checkpoint. https://pytorch.org/tutorials/beginner/saving_loading_models.html

• sentdex
November 22, 2020

Hey, I think a proper way to validate over the test set inside of your training loop is to do this once in a while as you otherwise end up taking the most of your time validating over your test set. Also, I don't think validating over a small fraction of your test set is not really valid. You definitely get wrong numbers as the accuracy for one fraction of the test set may be different to another fraction.

• sentdex
November 22, 2020

the best series I have ever known for learning pytorch! But it could be better if some code of photographing the feature map could be added. Anyway, give you a thumb!

• sentdex
November 22, 2020

• sentdex
November 22, 2020

How to show a graph in real-time when the model is still training?

• sentdex
November 22, 2020

Best series 🙂 Wanna learn more with pytorch. More series needed!! 💕

• sentdex
November 22, 2020

Can you please make a tutorial on distiller from intel

• sentdex
November 22, 2020

just finished the whole pytorch playlist !! love it thanks @sentdex keep it up 😉

• sentdex
November 22, 2020

• sentdex
November 22, 2020

Do you even plan on coming back to do data augmentation for unbalanced datasets or transfer learning?

• sentdex
November 22, 2020

How did you get the command prompt while in sublime?

• sentdex
November 22, 2020

Thank you for putting together this series. I really enjoyed watching it. Are you going to do any more video on pytorch?
Since you asked for requests, I will: Would love a video digging more in data preparation,including data augmentation. As you mention in your #5, data preparation can be a really tedious task.. would love to hear more about it 😀
Thanks again.Great job @sentdex

• sentdex
November 22, 2020

Don't spaghet to leave a like on the video people

• sentdex
November 22, 2020

Dude what happened to this series?? 🙁

• sentdex
November 22, 2020

pls continue this series 😀 . i'm waiting for that

• sentdex
November 22, 2020

Thank for the tutorials. but how do i use this model to other pitcher i took , i'm struggle load the image to this model,it error Expected 4-dimensional input for 4-dimensional weight [32, 1, 5, 5], but got input of size [1, 50, 50] instead

• sentdex
November 22, 2020

Thanks dude, that was awesome! 🙂