Spoilers

Learn about the learning outcomes of this chapter.

What to expect from this chapter

In this chapter, we will:

  • Briefly review the steps of gradient descent (optional).

  • Use gradient descent to implement a linear regression in Numpy.

  • Create tensors in PyTorch (finally!).

  • Understand the difference between CPU and GPU tensors.

  • Understand PyTorch’s main feature, autograd, to perform automatic differentiation.

  • Visualize the dynamic computation graph.

  • Create a loss function.

  • Define an optimizer.

  • Implement our own model class.

  • Implement nested and sequential models using PyTorch’s layers.

Get hands-on with 1400+ tech skills courses.