# Lecture 1 : PyTorch Basics & Linear Regression

English: https://youtu.be/5ioMqzMRFgM
Hindi: https://youtu.be/7yRkvPxE7Hs

Lecture Date and Time: November 21, 2020,

Notebooks:

1. PyTorch Basics: https://jovian.ai/aakashns/01-pytorch-basics
2. Linear Regression: https://jovian.ai/aakashns/02-linear-regression
3. Machine Learning Intro: https://jovian.ai/aakashns/machine-learning-intro

What to do after the lecture?

• Run the Jupyter notebooks shared above
• Start working on Assignment 1 - All About torch.Tensor

2 Likes

Using the train() function in the original notebook will rise an error because is missing the last argument (train_dl)

1 Like

@aakashns Sir please explain `requires_grad` set to `True`. again â€¦??? and its usesâ€¦??

requires_grad was difficult to understand, could you pl explain with simple practical use cases to start with?

@lakshaysethia @iamsusmita
if you set `requires_grad` to True to any tensor, then PyTorch will automatically track and calculate gradients for that tensor.
Now, why is this needed? Any Machine learning model will learn to predict better using an algorithm knows as Backpropagation, during backpropagation you need gradients to updates with new weights. This is done with the `.backward()` method, so during this operation tensors with `requires_grad` set to True will be used along with the tensor used to call `backward()` with to calculate the gradients.

Example:

``````import torch
x = torch.tensor(1.0, requires_grad = True)
z = x ** 3 # z=x^3
5 Likes

Hi, where can I find the link to the recorded English lecture conducted today (21/11/20) ?

Itâ€™ll be live streamed at 9pm IST (7:30 am PST)

Can someone provide any material to understand gradient of a matrix?

When I am installing a torch on my personal machine, it is showing an error.

When I am trying to install other libraries, I am able to install.
Can anyone help.

1 Like

Hello Jinesh,
Installing Pytorch in local machine requires another command as it depends on your machine whether it has GPU support or not. So choose the right combination you need by clicking here. The size of the installation will depend on what options you choose. GPU support takes more space so it is recommended to use colab.
Hope this helps

3 Likes

there are plenty of resources you just need to google it. watch a couple of youtube videos covering the basics.

I would suggest you to install Anaconda and then choose parameters based on your system and OS here PyTorch installation. Copy and conda command and run it, it will install all the necessary dependencies.

What is advantage of Pytorch over Tensorflow?

May I ask why the training data use ` dtype='float32'`, but before we use `float64`, does it relates to the computing speed here? thanks

Both are useful and intuitive in their own ways, although afaik Pytorch is from Microsoft whereas Tensorflow is from Google. Moreover Pytorch is fairly easy to use and beginner friendly for budding users. That was my perspective and will surely depend person to person.

U mean Pytorch was developed by Facebookâ€™s AI research lab, the windows version however is managed by Microsoft.

1 Like

Ohh! Didâ€™nt knew that. Thanks

Yeah, I read about that. Also, AMD is developing ROCm to translate Cuda code to some programming language independent code. So that AMD GPUs can also use CUDA like features.

Wow!, this is getting interesting.

2 Likes