Giter VIP home page Giter VIP logo

pytorchtutorial's Introduction

PyTorch Beginner Tutorials from my YouTube channel.

Watch the Playlist

Alt text

  1. Installation
  2. Tensor Basics
  3. Autograd
  4. Backpropagation
  5. Gradient Descent With Autograd and Backpropagation
  6. Training Pipeline: Model, Loss, and Optimizer
  7. Linear Regression
  8. Logistic Regression
  9. Dataset and DataLoader
  10. Dataset Transforms
  11. Softmax And Cross Entropy
  12. Activation Functions
  13. Feed-Forward Neural Net
  14. Convolutional Neural Net (CNN)
  15. Transfer Learning
  16. Tensorboard
  17. Save and Load Models

pytorchtutorial's People

Contributors

danblae avatar guidogallopyn avatar gyes00205 avatar kevinlin19910227 avatar patrickloeber avatar preyasgarg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pytorchtutorial's Issues

02_tensor_basics.py

Hi @python-engineer ,
on line 131, shouldn't we assign z again on CPU?
z = z.to("cpu") before then calling z.numpy()
I got following error without doing so:

TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

Thanks for all the great material!
Cheers,
Gautam

14_cnn.py line 117

Hi @python-engineer ,
Your codes and videos are really helpful thanks a lot!
Just a small doubt: in 14_cnn.py line 117 shouldn't be min(labels.size(0),batch_size) instead of batch_size . Otherwise if batch size = 3 you get an error.

optimizer.zero_grad() before loss.backward()?

Hi, Excellent tutorials! But I have a question. Form tutorial 13 and on you change the place where the zero_grad method is called and I do not get why?
Before 13 was:

loss = criterion(outputs, labels)
loss.backward()
optimizer.step()
optimizer.zero_grad()

After 13:

loss = criterion(outputs, labels)
optimizer.zero_grad() # Here is the change
loss.backward()
optimizer.step()

Now I am wondering if you set to zero the gradients, then, how the optimizer could update the parameters without any information about the gradient?

16_tensorboard.py

Hi, i have an question for the .py

line 141 :

class_labels.append(predicted)   

why not

class_labels.append(labels)

the add_pr_curve() function should use the ground truth label?

03_autograd.py L100

torch.version => '2.0.0+cu118'
L100: weights.grad.zero_()
show error "AttributeError: 'Tensor' object has no attribute 'grad_zero_'"

13_feedforward.py Lines (50, 51, 52)

Hello @python-engineer
thanks a lot for your videos. they are very helpful.
I have a cuda support and when I tried to run the code I got the error:
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument mat1 in method wrapper_addmm)

I solved that by adding:
.to(device) to the lines (50, 51, 52)

        self.l1= nn.Linear(input_size, hidden_size).to(device)
        self.relu= nn.ReLU().to(device)
        self.l2 = nn.Linear(hidden_size, num_classes).to(device)

and it runs now well

Mixed file names

Awesome tuts! Keep it up!
I think you mixed up names for 06_1_loss_and_optimizer.py (contains model) and 06_2_model_loss_and_ optimizer.py (does not).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.