Pytorch CNN example (Convolutional Neural Network)

preview_player
Показать описание
A walkthrough of how to code a convolutional neural network (CNN) in the Pytorch-framework using MNIST dataset. Explaining it step by step and building the basic architecture of the CNN.

❤️ Support the channel ❤️

Paid Courses I recommend for learning (affiliate links, no extra cost for you):

✨ Free Resources that are great:

💻 My Deep Learning Setup and Recording Setup:

GitHub Repository:

✅ One-Time Donations:

▶️ You Can Connect with me on:
Рекомендации по теме
Комментарии
Автор


Below you'll find both affiliate and non-affiliate links if you want to check it out. The pricing for you is the same but a small commission goes back to the channel if you buy it through the affiliate link.

Just a note is that ML course is free (only costs for a certificate) and the DL specialization lectures is also available on the deeplearning.ai youtube channel for free.

AladdinPersson
Автор

Your tutorials are really helpful. Thanks dude.

anshulthakur
Автор

This is really great! Thank you. Can you also do one for a regression problem using 1D CNN please? Keep it up!

thevgancheetah
Автор

thank you, you're a life saver!!

raghadabdulaziz
Автор

thank you for the best videos and I also read the comments below you are quite helpful. Bless you <3

Wanderlust
Автор

Hey there! First, I just want to thank you for this consistent, helpful and high-quality content. Second, don't know if it's a noob question or not, but while implementing this with a custom dataset (thanks to your other tutorial), I get an error during data loading that says that some image file pointed to by my csv file does not exist. However, when I check the root dir, the file is definitely there... Plus, at different run times, the file that can't be found is never the same! I didn't get this error when feeding the same images and csv file to googlenet. Can you think of any reason why I'm getting this?

Thanks again!

emilefortier
Автор

Thanks for the video! Can I ask about the stride? You use (1, 1) but won't that just move the kernel along the diagonal and ignore most of the image, leading to a 28x28 output that's mostly 0?

Fishes
Автор

@Aladdin Persson first of all i wanted to say thank you for your great videos. Second, can you prepare a video for time series forecasting using Transformers?

somayehseifi
Автор

I didn't see this in the video (may have skimmed over it), but I had to also remove the reshape() from my check_accuracy function as well before I could run it.

JipperGoneWild
Автор

Hi, could you please use some images to show that out put then this will be very helpful. Thanks

AmeerHamza-xmro
Автор

Thanks for the content and I like to know how we can implement CNN 1D. Can you share some tips

venkatesanr
Автор

does reshaping, remove the image spatial information? thank you

rs
Автор

Can we create the last fully connected layer inside the forward when we know the shape of X dynamically ? why do we statically define it as 16*7*7 ?

rahulseetharaman
Автор

Hey I was wondering about something from this video, as well as the previous one about NN, why did you specify super(NN, self).__init__() and not just super().__init__(), is there any particular reason for passing the NN class as well in the super function in pytorch?

niharmaheshgupte
Автор

Hey aladdin, Loved this tutorial. Doubt: In line 36 [7:00], why didn't you go for flatten instead of reshape. I mean flatten also does the same thing right?
And line 56: Shouldn't we set *shuffle=False* for test_loader?

ShashankShuklaBIS
Автор

a question:for the forward function in class CNN, why is it “ x = x.reshape(x.shape[0], -1) ” instead of " x = x.reshape(-1) " ? In my mind, x.shape[0] is the batchsize, but before the fc1, it should be an image, not 64 images. Thanks in advance.

MrTennis
Автор

hey i there can you please tell me how did you find the flattening layer dimensions . i had worked with ears so there was a function flatten . i think pytorch does not have the function for the task of flattening conv layers . please tell me if you would have a way or how did you calculate the dimension 16*7*7

thecros
Автор

Hej, thanks for the video! Can you please explain difference between: Conv1d, Conv2d, Conv3d? Thanks! Better with example on different types of
Data)

dktdklc
Автор

Is there a reason you don't apply a softmax at the end?

judahgoldfeder
Автор

Hello Aladdin, how do you know how many in_channels and out_channels are in your convolutional neural network?

joshlazor