Introduction to PyTorch

Поділитися
Вставка
  • Опубліковано 1 жов 2024
  • In the first video of this series, we give a broad overview of the parts of the PyTorch toolchain, including: Tensors, automatic gradient computation, model building basics, data loading abstractions, model training, and deployment for inference. This video is meant as a survey, with each topic being covered in more depth in subsequent videos.
    Download all notebooks here: pytorch-tutori...
    Download individual notebooks here:
    1. Tensors - 04:45 to 07:50
    pytorch-tutori...
    2. Autograd - 08:00 to 9:50
    3. A simple model - 10:00 to 14:00
    pytorch-tutori...
    4. Datasets - 14:00 to 17:10
    pytorch-tutori...
    5. Training loop - 17:10 to 21:00
    pytorch-tutori...

КОМЕНТАРІ • 72

  • @mosa36
    @mosa36 2 роки тому +40

    The colors make it really hard to read the slides

  • @ryanhoward5999
    @ryanhoward5999 2 роки тому +69

    If PyTorch is so smart, why can't you use it to increase your video BRIGHTNESS GODD!!!

    • @luisfelipecarreira
      @luisfelipecarreira 5 місяців тому +5

      If you didn't pay, why are you complaining about a knowledge being shared for free? It's not that dark...

  • @manuelplank5406
    @manuelplank5406 2 роки тому +32

    Love how he roasts his CPU while training

  • @deehzee
    @deehzee 2 роки тому +19

    Very hard to read the slide due to unfortunate choices of font colors (no contrast)

    • @mikeanthony773
      @mikeanthony773 Рік тому +2

      I think the brightness is too low. This is how a monitor looks with no backlight. You can see at 3:20ish the slide suddenly becomes bright and readable and then the video stays that way.

  • @nafisaanjum1146
    @nafisaanjum1146 3 роки тому +75

    0:00 Intro
    0:52 PyTorch Installation
    1:32 What is PyTorch
    3:51 Tensors
    7:56 Autograd
    10:00 A simple model
    14:00 Datasets
    17:00 Training Loop
    21:15 Deployment

  • @user-or7ji5hv8y
    @user-or7ji5hv8y 3 роки тому +23

    Audio volume is a bit low.

    • @drmosfet
      @drmosfet Рік тому

      I have to turn up the volume to hear you, When the commercial come on the audio levels or high enough to wake up every one in the house.

  • @felixx2012
    @felixx2012 5 місяців тому +1

    For me "images, labels = dataiter.next()" returns the following error: "AttributeError: '_MultiProcessingDataLoaderIter' object has no attribute 'next'". I fixed this by changing the line to "images, labels = next(dataiter)" which I think is the correct implementation.
    But I am still confused, surely an official tutorial video is not mistaken.

  • @rmajdodin
    @rmajdodin 2 роки тому +26

    7:04 it should be (torch.rand(2,2) -0.5) * 2, otherwise it works like torch.rand(2,2) -1, because of operator precedence

  • @chucksaber8332
    @chucksaber8332 Рік тому +3

    loss.backward() does not compute at 9:42 lol

  • @kalok87
    @kalok87 2 роки тому +12

    Hello, something might be wrong there. at 11:01 we have the C1 size (28*28), and the code in the comment said "# 1 input image channel (black & white), 6 output channels, 3x3 square convolution". But apply a 3*3 window on 32*32 input will get 30*30 output. I think the graph describes the structure in the original paper which was using 5*5 window at C1.

  • @PRonYouTube
    @PRonYouTube Рік тому +5

    Is there a typo ~ 15:10 when the image normalization is done? if we're seeking to achieve an average of 0, shouldn't the first tuple passed in be (0, 0, 0) instead of (0.5, 0.5, 0.5)?

  • @RajarshiBandopadhyay
    @RajarshiBandopadhyay Рік тому +3

    Is it just my machine, or is this video kinda dark?

  • @emrek1
    @emrek1 3 роки тому +20

    I think in code segment 6 the first line should be r1 = (torch.rand(2,2)-0.5) * 2
    otherwise it will be equivalent to r1 = torch.rand(2,2) - 1

    • @rohith2454
      @rohith2454 2 роки тому +5

      yes , I was wondering the same, glad to see your comment

  • @aimatters5600
    @aimatters5600 Рік тому +2

    increase your browser window man. hard to read

  • @niyongaboeric
    @niyongaboeric 2 роки тому +7

    I like the introduction video as I could see how you can use Pytorch to train model, visualize results and deploying in production. You helped me and I just want to say thank you.

  • @josechavez8754
    @josechavez8754 2 роки тому +2

    HI, I get this error when runnung the dataset notebook. "URLError: " Can it be fixed?

  • @needmusic790
    @needmusic790 Рік тому +3

    WHY THE VIDEO IS SO DARK?

    • @mikeanthony773
      @mikeanthony773 Рік тому

      Some kind of issue with the upload or brightness or something. It goes away at 3:20.

  • @heera_ai
    @heera_ai 2 місяці тому

    @11:35 LeNet model for the 32X32 one channel images.
    import torch
    import torch.nn as nn
    import torch.nn.functional as F
    class LeNet(nn.Module):
    def __init__(self):
    super(LeNet, self).__init__()
    self.conv1 = nn.Conv2d(1, 6,3)
    self.conv2 = nn.Conv2d(6, 16, 3)
    self.fc1 = nn.Linear(16*6*6, 120)
    self.fc2 = nn.Linear(120, 84)
    self.fc3 = nn.Linear(84,10)
    self.relu = F.relu
    def forward(self , x):
    x = self.conv1(x) #input shape 32X32 -> ouput shape 30X30
    x = self.relu(x)
    x = F.max_pool2d(x ,2) #input shape 30X30 -> ouput shape 15X15
    x = self.conv2(x) #input shape 15X15 -> ouput shape 13X13
    x = self.relu(x)
    x = F.max_pool2d(x ,2) #input shape 13X13 -> ouput shape 6X6
    x = torch.flatten(x)
    x = self.fc1(x)
    x = self.relu(x)
    x = self.fc2(x)
    x = self.relu(x)
    x = self.fc3(x)
    return x
    net = LeNet()
    input_image = torch.rand(1, 1, 32, 32)
    output = net(input_image)
    output

  • @nicolasaragon1078
    @nicolasaragon1078 10 місяців тому +1

    I found this helpful. Thanks for sharing this tutorial!
    I found a problem in the Autograd section, which could be corrected. I'm using Pytorch2.1.1 and it seems that `loss.backdward()` requires that the tensors get constructed with `requires_grad=True`.
    I checked the documentation and it seems that this is the default, but it didn't work for me until I specified the value explicitly.

  • @interesting_stuffs
    @interesting_stuffs Рік тому +1

    good videos but audio quality in these videos is very poor, anyway to improve it?

  • @davidmurphy563
    @davidmurphy563 Рік тому +1

    Obviously this is a year old and the narrator probably won't see this but a zoomed in view would make this infinitely more accessible on mobile. Great video regardless.

  • @heera_ai
    @heera_ai 2 місяці тому

    @7:14
    r = (torch.rand(2,2) - 0.5) * 2 # normalize values to -1. to 1.
    r = torch.rand(2,2) - 0.5 * 2 # generates random values in range of [-1., 0.]
    @8:00 Set requires_grad = True
    example:
    x = torch.rand(1, 10, requires_grad = True)

  • @scaredyfish
    @scaredyfish Рік тому +2

    16:54 I get an error on dataiter.next() - next(dataiter) works

  • @d.mort.
    @d.mort. 3 роки тому +4

    This was quite a good rapid intro video. Thank you very much!

  • @user-or7ji5hv8y
    @user-or7ji5hv8y 3 роки тому +2

    Does PyTorch have something equivalent to TensorFlow Probability?

  • @heera_ai
    @heera_ai 2 місяці тому

    @8:00 Set requires_grad = True
    example:
    x = torch.rand(1, 10, requires_grad = True)

  • @CaptainKokomoGaming
    @CaptainKokomoGaming Рік тому

    Where do I run these commands??? I am trying to teach myself this stuff on the fly but my wings are on fire. I only want to learn ths stuff to stop the damn cuda errors on my Stable Diffusion local install. It's driving me nuts! I don't know where to put the "torch.cuda.empty_cache()" either.
    Can someone please help me?

  • @dibyaranjansahoo4552
    @dibyaranjansahoo4552 2 роки тому +1

    o boy is the noise because of model training 😏

  • @pouyanebrahimilialekol2197
    @pouyanebrahimilialekol2197 2 роки тому +1

    Thanks for the video. If the CIFAR10 dataset isn't downloading by the code, you may for as below:
    import ssl
    ssl._create_default_https_context = ssl._create_unverified_context
    trainset = torchvision.datasets.CIFAR10(root='./data', train=True,
    download=True, transform=transform)

  • @Sirvaiya
    @Sirvaiya 3 роки тому +2

    thanks a lot. very good video. It was littleee fast i think. And best thing was there was no ad for me :)

    • @Sirvaiya
      @Sirvaiya 3 роки тому

      Hope to see more like these :)

  • @kavorka8855
    @kavorka8855 7 місяців тому

    the video's dim, very difficult to follow

  • @clearmind9817
    @clearmind9817 2 роки тому

    It is only reading the scripts! We can read them too! Unfortunately not a perfect tutorial 😒

  • @Raminder1984
    @Raminder1984 Рік тому

    great video. in the net class at 18.03 needs num_flat_features function without which it wont run looks like.

  • @emmanuelakpet4735
    @emmanuelakpet4735 6 місяців тому

    Am I the only one that feels the display brightness is too low?

  • @deeptisinha7348
    @deeptisinha7348 2 місяці тому

    Slides are not readable.

  • @golgiwaffles
    @golgiwaffles Рік тому

    I dont seem to understand the AutoGrad aspect as im doing this with no prior ML/DL knowledge. Am i on the right track, or must i learn something prior to his

    • @morancium
      @morancium Рік тому

      i thiiink you should have atleast basic understanding of backpropogation

  • @yolowex6876
    @yolowex6876 Рік тому

    For God's sake please increase your text size

  • @Tina-gj9qw
    @Tina-gj9qw 2 роки тому

    I got a “name ‘transform’ is not defined”when creating a CIFAR10 dataset on 15:14. Still wondering how to fix this.

    • @Tina-gj9qw
      @Tina-gj9qw 2 роки тому

      i got it:i forgot to run some cells above😓

  • @jeffg4686
    @jeffg4686 2 роки тому

    PyTorch only has 27K subscribers ?

  • @imperfect7719
    @imperfect7719 Рік тому

    what is this interface that starts from 4:35 ?
    where am I gonna actually write this codes if iam onto building some model using Pytorch?

    • @Schaelpy
      @Schaelpy 10 місяців тому

      It is a Jupyter Notebook. You can write Python code basically everywhere with a terminal but an IDEs is recommended. Or for beginners, Google Colab and Kaggle are good choices

  • @angelsancheese
    @angelsancheese 3 роки тому +1

    Thank you for the video

  • @pullrequest1296
    @pullrequest1296 3 роки тому +1

    Glad to see 720p back.

  • @satvikvenkatesh
    @satvikvenkatesh 2 роки тому +1

    An excellent tutorial!! Thank you.

  • @BlackHermit
    @BlackHermit 2 роки тому +1

    Great introduction! Thanks

  • @da-hn
    @da-hn 2 роки тому

    1729, the hipster version of 42

  • @Schaelpy
    @Schaelpy 10 місяців тому

    Loved that Video! Thank you so much

  • @istvanszepesi-nagy2516
    @istvanszepesi-nagy2516 Рік тому

    nice "how to read the text" tutorial!

  • @whatRedditSaysToday
    @whatRedditSaysToday Рік тому

    Is this synthetic voice?

  • @samrasoli
    @samrasoli Рік тому

    useful

  • @yuanjizhang9753
    @yuanjizhang9753 3 роки тому

    How does torchscript compare to onnx?

  • @Yilgrimage
    @Yilgrimage Рік тому

    It really help a lot!😀

  • @PurtiRS
    @PurtiRS 11 місяців тому

    Low brightness, low contrast, low readability, low volume, content is good, but I don't like the mouth sounds in between the words, very distracting, and these are pronounced because I have to increase the volume too high to listen to the content. Kya official video banayega re tu.

  • @NishantKumar-mp9zg
    @NishantKumar-mp9zg 3 роки тому +2

    There is a background noise that continuously comes forth .
    It's a static sound that occurs in the second last module.
    Request you to kindly check it out .