Deep Learning Lab 2: Autograd - automatic differentiation

less than 1 minute read

Deep Learning Lab 2

This lab covers pyTorch automatic differentiation (autograd). At the end a simple non-linear regression model is presented. In details the following topics are covered:

  • Visualizing the computational graph
  • Gradient accumulation
  • Non-linear regression with a neural network

Non-linear regression

The sample in the Jupyter notebook present the non-linear model below: \(y = -(0.1 x_1^2 + 3 sin(0.1 x_2) +0.1)\)
Non-linear function

We will solve this problem using a simple neural network using a single hidden layer with no activation function:
Neural Network

Here is the link to access the notebook on Google colab. It doesn’t work directly on github.