Chapter 3: PyTorch Tensors

Introduction

face Luca Grillotti

In the previous chapter, we implemented a Gradient Descent algorithm!

However, as you probably noticed, our gradient was easy to compute:

  • we knew analytically that \dfrac{\partial L}{\partial \theta} = 2\theta (in our example)
  • our variable \theta is 1-dimensional.

In the following chapters, we will see how to use the PyTorch Machine Learning library to:

  1. automatically compute the gradients for us
  2. automatically perform gradient descent

However, before doing all this, we should start with the basics: creating and manipulating the PyTorch main objects: tensors.