Building a Neural Network with PyTorch in 15 Minutes | Coding Challenge

  Переглядів 144,880

Nicholas Renotte

Nicholas Renotte

Рік тому

What's happening guys, welcome to the third episode of CodeThat!
In this ep I try to build my first neural network in PyTorch...seriously the first time I even dug into their documentation was yesterday! Anyway you know the rules I have to get it done in 15 minutes, no doco or stack overflow and a gift card to you guys if I fail.
Will I make it in time???!
Get the Code: github.com/nicknochnack/PyTor...
Oh, and don't forget to connect with me!
LinkedIn: bit.ly/324Epgo
Facebook: bit.ly/3mB1sZD
GitHub: bit.ly/3mDJllD
Patreon: bit.ly/2OCn3UW
Join the Discussion on Discord: bit.ly/3dQiZsV
Happy coding!
Nick
P.s. Let me know how you go and drop a comment if you need a hand!
#machinelearning #codingchallenge #gradientdescent

КОМЕНТАРІ: 167
@andyweb7779
@andyweb7779 11 місяців тому
The amount of calculating a Terminator has to do just to work out if someones boots, clothes and motorcycle will do him is wild lol.
@FleiX664
@FleiX664 2 місяці тому
Imagine Skynet.
@artid8896
@artid8896 Рік тому
Nick, we appreciate your work so much. The way you offer your knowledge so graciously, you're helping so many people who are newbies in the field.
@NicholasRenotte
@NicholasRenotte Рік тому
Knowledge is one of the few things you can give away and not lose, so why not share?! Thanks so much for checking it out @NeonCone!
@sadra2637
@sadra2637 Рік тому
Good job man. I feel more and more in love with ML and DL as I watch your videos. Keep it up. 👊
@NicholasRenotte
@NicholasRenotte Рік тому
YESSS, love that you're getting into it!
@mansoorbaig9232
@mansoorbaig9232 Рік тому
Great explanation of all that is need in 15 min. Keep up the good work, your tutorials are a great help to DS community.
@baguette184
@baguette184 2 місяці тому
youre literally the best, i genuinely appreciate all the work youve put out for us. you have no idea how much help your channel has given me, without you i wouldve been completely lost in everything, thank you so much, i love you 😭♥
@thealmighty9
@thealmighty9 Рік тому
Wow this was so good! I can't believe you still take time to explain things throughout the challenge lol. I am loving this series, super fun :D
@jinparksoul
@jinparksoul 9 місяців тому
"I can't believe you still take time to explain things throughout the challenge". I can't literally can't believe it either. Drink a shot every time he typed a line with no explanation and you'll be dead half way through the video. There is no freaking way a beginner understands wtf just happened by the end.
@thealmighty9
@thealmighty9 9 місяців тому
@@jinparksoul This video isn't a tutorial for beginners though, it's a challenge he made for himself. If you want a tutorial look through his countless videos where he explains every little thing that even you can understand.
@jinparksoul
@jinparksoul 9 місяців тому
@@thealmighty9 Nonetheless its still true that most of the lines are written without any explanation regardless of who it is targeted towards in contradiction to what your comment "you still take time to explain things" implies. Although not really done here taking time to explain everything is typically something you would not need to do when you target experienced AI researchers and pytorch devs.
@thealmighty9
@thealmighty9 9 місяців тому
@@jinparksoul So there is only explain everything or nothing? Only beginners and experienced professionals? "Take time to explain things" is not saying "takes time to explain every little thing" I'm not sure what you're trying to get at here, I don't know if you're upset that he doesn't explain enough or upset that he explained anything at all.
@gabrielj.9028
@gabrielj.9028 Рік тому
Great job! Your videos have really helped me with project ideas and application examples. Looking forward to seeing more!
@NicholasRenotte
@NicholasRenotte Рік тому
YESSS, go getem @Gabriel!! Plenty more to come.
@AsherNoor777
@AsherNoor777 Рік тому
Yo! that is EPIC! Super intense! and SUPER helpful! thank you so much for sharing, this is giving me hope for my ML project for sure! And yes, I TOTALLY take this as a Win. Amazing job!
@bguerrae
@bguerrae Рік тому
That was incredible! thank you so much for making it look so easy to implement. you are great!
@gustavojuantorena
@gustavojuantorena Рік тому
This is awesome Nick! I'm amazed by the way you can also explain while coding really fast 😂
@NicholasRenotte
@NicholasRenotte Рік тому
I have no idea how I pulled this off 😂
@primeq
@primeq 21 день тому
great job Nick. It's impossible to overstate how powerful speed, clarity are when it comes to learning/teaching. 🌟
@erfanelmtalab1615
@erfanelmtalab1615 Рік тому
nick you are my hero for real , thank you for your tutorials man !
@NicholasRenotte
@NicholasRenotte Рік тому
Ayyyy, thanks so much @Erfan!
@omarkhamismohamed9563
@omarkhamismohamed9563 Рік тому
Super underrated .. Amazing explanation during challenge !!!!
@saleemmuhammed5133
@saleemmuhammed5133 Рік тому
This is what I exactly wanted.. Awesome stuff!!
@petegrapentien4147
@petegrapentien4147 2 місяці тому
This is the most fun I've ever had watching a coding video
@GX-uq1hm
@GX-uq1hm Рік тому
Nicholas, what monitors do you use there for coding? your workplace looks fantastic !!
@TheCopernicus1
@TheCopernicus1 Рік тому
Awesome content as always mate! well done :)😀
@NicholasRenotte
@NicholasRenotte Рік тому
Cheers @Bass Azayda!!
@ganesh-uc2ft
@ganesh-uc2ft Місяць тому
This was fun! Thank You for the amazing tutorial.
@neuralnexus340
@neuralnexus340 6 місяців тому
Love this video It actually helped me start using pytorch
@ChrisOndrovic
@ChrisOndrovic Місяць тому
Man awesome video, do you have or could you do one doesn't have to be a timed coding challenge but instead if you want to create your own dataset as opposed to using an existing one
@vincentmarkiet
@vincentmarkiet Рік тому
Awesome stuff. Keep at it mate.
@NicholasRenotte
@NicholasRenotte Рік тому
Cheers Vincent!!
@amahdaniel3633
@amahdaniel3633 Рік тому
Great! Nicholas, thanks for sharing. Please how would one handle labels for classification, is this method foolproof to using LabelImg? Thanks.
@anshverma2820
@anshverma2820 Рік тому
Thanks Nick! That was an amazing video.
@NicholasRenotte
@NicholasRenotte Рік тому
Thanks a mil for checking it out @ansh!
@MichaelMacedoDiniz
@MichaelMacedoDiniz Рік тому
Very nice content, congratulations !!!!
@dasamlan9874
@dasamlan9874 Рік тому
Great vid. I started ML a year ago and I could understand approx 70-75% of the vid.... can u do a vid on audio processing or provide some resources for the same. Audio processing, noise classification and similar stuffs. And once again a BIG thank u for these vids.. really helpful!!
@NicholasRenotte
@NicholasRenotte Рік тому
Heya @Das, check this out: ukposts.info/have/v-deo/knx6hKGkpHp7opc.html
@dasamlan9874
@dasamlan9874 Рік тому
@@NicholasRenotte once again.. Thanx a lot. 😁
@Markom3D
@Markom3D Рік тому
Hey, i might have to take this format for my live streams…. Subscribed good sir
@NanoCreator
@NanoCreator Рік тому
This is a good teaching!!! you are great!!!
@justinbenavidez1985
@justinbenavidez1985 Рік тому
great video and amazing coding!!
@armaaanziyad2772
@armaaanziyad2772 Рік тому
Nick amazing work you really are a pro!
@NicholasRenotte
@NicholasRenotte Рік тому
You're too kind, thanks @Armaaan!
@MatthewOrbuch
@MatthewOrbuch Рік тому
If this were not a rushed challenge but a proper tutorial explained a bit more calmly, it would be pure gold
@sanky369
@sanky369 11 місяців тому
Put the code in chatGPT and ask for explanation. 😇
@choz8358
@choz8358 4 місяці тому
Thanks for the content, as a newb I learned a lot here 👍
@arjunbali2079
@arjunbali2079 Рік тому
Hi Nicholas I started following your channel after your series on siamese network. Like this can we build multiple language OCR for example in a sentence there is english, hindi and german together written the classifier translate them all together and give us the result in the required language
@toni3124
@toni3124 Рік тому
Love your vids! could you maybe make a video about a TTS system based on the LJ Speech Dataset?
@NicholasRenotte
@NicholasRenotte Рік тому
Will take a look!
@vladislavraskoshinskii9681
@vladislavraskoshinskii9681 7 місяців тому
Hi What VS Code theme are you using?
@user-uh7jb9jo5w
@user-uh7jb9jo5w 8 місяців тому
Could this be used to bypass Robot image validation ?
@ajaykumar-rh2gz
@ajaykumar-rh2gz Рік тому
Amazing bro love the way teach
@mishmohd
@mishmohd 9 місяців тому
11:17 don’t u need to put it in eval mode when predicting and train mode when training?
@dactoanho6026
@dactoanho6026 18 днів тому
Thank you very much for your video. it's very helpful
@OvettaSampson-vz4en
@OvettaSampson-vz4en 2 місяці тому
This was fun to watch.
@kamalakannank2741
@kamalakannank2741 9 місяців тому
Sir, Which document you read to write this code?
@rverm1000
@rverm1000 Рік тому
Glad you got it deploy. No one seems to get that far
@papakamirneron2514
@papakamirneron2514 2 місяці тому
Finally, a tutorial for just the useful stuff
@neilrenaud5962
@neilrenaud5962 4 місяці тому
Job well done .Way to go
@gblazerify
@gblazerify Місяць тому
Amazing!
@einsteinsboi
@einsteinsboi Рік тому
Legend! That was epic!
@NicholasRenotte
@NicholasRenotte Рік тому
Thanks a mil @maryml
@ai__wizard__
@ai__wizard__ Рік тому
That was truly amazing
@NicholasRenotte
@NicholasRenotte Рік тому
Thank you so much @Murat!!
@sitrakaforler8696
@sitrakaforler8696 Рік тому
Dam dude !!!!!!!!!!!!!!!!!!!!!!!!! You are wild ! Bravo
@gadmuhirwa5226
@gadmuhirwa5226 10 місяців тому
oohh my God you made proud and happy you build my confidence brother @ Nicholas I can't stop laugh for your celebration
@alexvajith6337
@alexvajith6337 Рік тому
Hey nice video yaar! How did you learn the maths = stride subtraction and all.... It would be great if someone give some reference
@nikaize
@nikaize Місяць тому
Easy !!!! Good job !!!
@adityashukla7849
@adityashukla7849 Рік тому
Phenomenal!
@NicholasRenotte
@NicholasRenotte Рік тому
Cheers @Aditya!
@SomebodythatIusetoknow123
@SomebodythatIusetoknow123 Місяць тому
well played
@Nmind-Nbody
@Nmind-Nbody Рік тому
Awesome Broo!!!😱
@wesleybarreto9245
@wesleybarreto9245 Рік тому
Good job Nick! Huge W. I was wondering as to why the loss was increasing after every 4 epochs, is it because a new batch is fed in to the model?
@NicholasRenotte
@NicholasRenotte Рік тому
Heya Wesley!! First one finally!! Probably getting to the point of overfitting but we're only printing out after every epoch not per batch. Loss bumps up in epoch 4 but still drops in epoch 8 (take a look at the power e-6 as opposed to e-5)
@wesleybarreto9245
@wesleybarreto9245 Рік тому
@@NicholasRenotte Oh right. I completely missed the e-6 😂
@dsc40sundar18
@dsc40sundar18 Рік тому
preety amazing and big fan bro
@julianchambrier2401
@julianchambrier2401 Рік тому
Good job and Congratulations ! Is it possible to make a video on lip sync with Tensorflow from a video file and a text/audio file generating a deepfake? For example a video of you with speech of Martin Luther King (with your voice) ? I think it could interest a lot of people
@NicholasRenotte
@NicholasRenotte Рік тому
Oooooh, I'll dig into it!
@lakshman587
@lakshman587 Рік тому
So you won!! Congratulations!!!!
@NicholasRenotte
@NicholasRenotte Рік тому
I have never written 50+ lines of code so fast in my life!! Thanks a mil @Lakshman. Was looking close towards the end there!!
@lakshman587
@lakshman587 Рік тому
@@NicholasRenotte Noice! You did it!!
@mahsakhoshnoodi2972
@mahsakhoshnoodi2972 Рік тому
Nice challenge 🤩
@NicholasRenotte
@NicholasRenotte Рік тому
Thanks a mil @Masha!!
@nicky6917
@nicky6917 Рік тому
This is the longest 15 min ever in my life
@billal2731
@billal2731 Місяць тому
I can finally ad Machine Learning to my resume
@dadanny661
@dadanny661 8 місяців тому
Instead of printing the epoch loss, didn't you print the loss of the last batch of the epoch ?
@chiragparmar3678
@chiragparmar3678 11 місяців тому
one question i have is why did u not defined your yhat as clf.predict(x) instead you took only clf(x)
@sergioquijano7721
@sergioquijano7721 Рік тому
Shortcut of the video? Toggle/Hide command line inside VSCode: ctrl + J (command + J in mac) Hope you remember my shortcuts
@fizipcfx
@fizipcfx Рік тому
Awesomeee
@dubble_g
@dubble_g 11 місяців тому
i have way more detailed images that are 128x128 and my NN is really bad at predicting, any tips what i should try to adjust besides the learnign rate?
@Michallote
@Michallote 2 місяці тому
Use yolo
@danny9642
@danny9642 7 місяців тому
How long does this take to train on a CPU and how can I optimise the code for it to train faster when using CPU?
@Connecttechaarushenglish-ox111
@Connecttechaarushenglish-ox111 2 місяці тому
It will triple the time that the gpu takes to train😅😅. You can just remove .to("cuda"). Now you understand it.
@coolsai
@coolsai Рік тому
God level
@harshraithatha
@harshraithatha Рік тому
Hey Nick, I have sensitive data in my dataset. I need it to train my model. But also want to mask it. What to do?
@NicholasRenotte
@NicholasRenotte Рік тому
I deal with this a lot at work, check with your privacy policies but the model itself won't contain the raw data just what the NN has learned.
@MrSanselvan
@MrSanselvan Рік тому
Nice. The loss is increasing after the 3rd epoch. Is it good sign or bad ?
@danielpaul8734
@danielpaul8734 Рік тому
It is not. Notice that the loss will be written in scientific notation after the 3rd epoch
@rachelthornton4161
@rachelthornton4161 Рік тому
Skillz !!!
@fairyroot1653
@fairyroot1653 Рік тому
Can this model predict a sequence of numbers in captcha based images with digits and/or letters?
@NicholasRenotte
@NicholasRenotte Рік тому
Would need to be tweaked to do that!
@fairyroot1653
@fairyroot1653 Рік тому
@@NicholasRenotte can you demonstrate how?
@philtoa334
@philtoa334 Рік тому
Great ! but... This time I especially learned that I could have bad thought for you . For a gift card ... 🤣
@NicholasRenotte
@NicholasRenotte Рік тому
LOL I think the code that series isn’t ending anytime soon. might just need to start making some ridiculous challenges.
@shabbirali4096
@shabbirali4096 Рік тому
Awesome 😆
@chiscoduran9517
@chiscoduran9517 Рік тому
Hi, there is something that always confused me when working with conv networks, when you set the input layers in the nn.Linear(), you set it as 64*(28-6)*(28-6), why is that? how to know how many inputs and outputs you have to have when combining conv nodes with linear nodes, thanks great video :)
@NicholasRenotte
@NicholasRenotte Рік тому
Look under the shape section here: pytorch.org/docs/stable/generated/torch.nn.Conv2d.html , the formula for calculating the height and width of the output are shown there (see Hout and Wout)
@NicholasRenotte
@NicholasRenotte Рік тому
If I adjusted kernel size, padding or stride then the output shape would’ve changed accordingly @Chisco!
@nikitaandriievskyi3448
@nikitaandriievskyi3448 Рік тому
If you have an image of let’s say 28*28 shape, and you pass it through a 3by3 filter with a stride of 1, and 0 padding, then ur output Shape would be: 28-3 + 1 by 28-3+1. The general formula for shapes after passing through a conv layer is ((input_shape +2*padding size - filter size) / stride) + 1 and then floor the results, so if it’s 3.5 you should round to the bottom, and you will have 3
@NicholasRenotte
@NicholasRenotte Рік тому
What Nikita said is bang on!
@alexzan1858
@alexzan1858 Рік тому
does pytorch have better/faster training compared to tensorflow?
@Michal2SAB
@Michal2SAB Рік тому
Why sometimes in accuracy, loss or whatever, one of these.. weird letters are present? Like a big number 0.12202020202-e545. Is it a problem? I found that to be confusing when predicting cause then the model inaccuratly predicts for some reason. Or perhaps it's not a problem and I just can't do simply "if accuracy > 0.5" in that case and THAT's the issue
@Connecttechaarushenglish-ox111
@Connecttechaarushenglish-ox111 2 місяці тому
No it is not a problem. Sometimes, when accuracy or loss or both are very small or big then it uses some words like 341e78
@gplgomes
@gplgomes Рік тому
Nocholas, you are the guy.
@NicholasRenotte
@NicholasRenotte Рік тому
Cheers @Geraldo!
@vinsmokearifka
@vinsmokearifka Місяць тому
Haha very interesting show
@fizipcfx
@fizipcfx Рік тому
Do you plan to make another streams.
@NicholasRenotte
@NicholasRenotte Рік тому
OFC, normally aim for two a week. This week was a bit of an exception.
@fizipcfx
@fizipcfx Рік тому
@@NicholasRenotte i got you, thanks for the reply
@irugal8964
@irugal8964 Рік тому
😎 We always appreciate your content Nich
@NicholasRenotte
@NicholasRenotte Рік тому
Thanks a million @Irugal, means a ton!!
@user-uh8yr6uh9w
@user-uh8yr6uh9w 2 місяці тому
why are we giving (1,32,(3,3)) in conv2d and then (32,64,(3,3)) , how is it decided? can someone explain
@fahnub
@fahnub 3 місяці тому
You da GOAT
@cagataydemirbas7259
@cagataydemirbas7259 Рік тому
Hi, Im confused about cross validation. I looked videos they just use cross_val_score. I want to train data using cross validation and predict test daha how can I do it with cross validation. I want train cross validation and apply other datas how can i do it
@NicholasRenotte
@NicholasRenotte Рік тому
Take a look at GridSearchCV in sklearn
@cagataydemirbas7259
@cagataydemirbas7259 Рік тому
@@NicholasRenotte thank you. gridsearh tests some parameters after tested when we predict it uses best parameters ? or should we trained again by best parameters
@andyweb7779
@andyweb7779 11 місяців тому
Is the tensor mathematics involved in neural networks the same as the tensor mathematics invented by Albert Einstein for his work on general relativity?
@shaunpx1
@shaunpx1 Рік тому
hey if you eve want to do a race id be down for a challenge
@sebastianrothe
@sebastianrothe Рік тому
awesome & fun , at least if you don't try to follow typing :) thx alot
@NicholasRenotte
@NicholasRenotte Рік тому
LOL, yeah it was a little fater than my usual pace
@sebastianrothe
@sebastianrothe Рік тому
@@NicholasRenotte but it was Fun trying :) Maybe you can do a series like this From tiny world problem to live solution? That would be cool to See the process and thoughts
@thiagosnelli138
@thiagosnelli138 Рік тому
Hi mate, I'm using the CPU, what should I type on line 57?
@thiagosnelli138
@thiagosnelli138 Рік тому
Well, answering my own concern, for the CPU guys: line 58 change for: clf.load_state_dict(torch.load(f, map_location='cpu'))
@sridhardornadula3913
@sridhardornadula3913 Рік тому
hello bro...how to install pytorch in windows 11 or any alternate apk
@georgebassemfouad
@georgebassemfouad Рік тому
Hi I have a question.. what is the difference between tensorflow and pytorch
@NicholasRenotte
@NicholasRenotte Рік тому
Similar, just different implementations TF: from Google, PT: from Facebook
@user-nq5uh1iu2q
@user-nq5uh1iu2q 5 місяців тому
This dude is an O.G.
@fulltimefrontend
@fulltimefrontend 10 місяців тому
Tell how to build my machine ! I want to setup just like you have.
@AndersAlsDieAnderen9
@AndersAlsDieAnderen9 Рік тому
Hey! Noob here: How does he comment multiple lines at 16:50? I always use ''' text ''' but that is just shit. How do I use # Infront of multiple lines at the same time.
@AllenThomasVarghese
@AllenThomasVarghese 6 місяців тому
In VSCode, you select multiple lines and press Cmd + / (on Mac) to comment the lines out similar how to you do for a single line
@harryslaughter3151
@harryslaughter3151 2 місяці тому
You've got 5 minutes to write hello world. Me: .... (◉▂◉ ) ..... (⊙.⊙) .... 5 mins later .... .... ¯\_(ツ)_/¯
@mithrixx
@mithrixx 10 місяців тому
I like this
@undokat
@undokat 8 місяців тому
6:08 i don't know what you are doing what are those?
@dsc40sundar18
@dsc40sundar18 Рік тому
love from india and i am so happy
@jamesderiter4370
@jamesderiter4370 9 місяців тому
This dude is an irl character from bigmouth
@ifthikhanmohamed1681
@ifthikhanmohamed1681 Рік тому
it throws a runtime error
@hellogoodbye637
@hellogoodbye637 11 місяців тому
What does this Neural Net actually do though?
@kevynkrancenblum5350
@kevynkrancenblum5350 Рік тому
🥳
@NicholasRenotte
@NicholasRenotte Рік тому
Time to partayyyyy, thanks @Kevyn!
@kevynkrancenblum5350
@kevynkrancenblum5350 Рік тому
You earn that 6pm pizza 🍕 😂
@amritanjanthakur6510
@amritanjanthakur6510 10 місяців тому
Wow
Build Your First Pytorch Model In Minutes! [Tutorial + Code]
31:32
Rob Mulla
Переглядів 54 тис.
Create a Basic Neural Network Model - Deep Learning with PyTorch 5
15:40
PyTorch Crash Course - Getting Started with Deep Learning
49:55
AssemblyAI
Переглядів 75 тис.
Building a Machine Learning API in 15 Minutes | Coding Challenge
20:04
Nicholas Renotte
Переглядів 117 тис.
But what is a neural network? | Chapter 1, Deep learning
18:40
3Blue1Brown
Переглядів 16 млн
Pytorch Transformers from Scratch (Attention is all you need)
57:10
Aladdin Persson
Переглядів 287 тис.
PyTorch vs TensorFlow in 2023 FULL OVERVIEW
13:29
Team Up With AI
Переглядів 27 тис.
How to Code a AI Trading bot (so you can make $$$)
35:09
Nicholas Renotte
Переглядів 434 тис.
Convolutional Neural Nets Explained and Implemented in Python (PyTorch)
34:48
PyTorch in 100 Seconds
2:43
Fireship
Переглядів 801 тис.
PyTorch vs TensorFlow | Ishan Misra and Lex Fridman
3:47
Lex Clips
Переглядів 103 тис.
Клавиатура vs геймпад vs руль
0:47
Balance
Переглядів 962 тис.
Самый маленький Iphone в мире!📱(@ghoul.arena)
0:22
Взрывная История
Переглядів 333 тис.
Which Phone Unlock Code Will You Choose? 🤔️
0:14
Game9bit
Переглядів 4,8 млн