Exercise

Your first neural network

In this exercise, you will implement a small neural network containing two linear layers. The first layer takes an eight-dimensional input, and the last layer outputs a one-dimensional tensor.

The torch package and the torch.nn package have already been imported for you.

Instructions

100 XP
  • Create a neural network of linear layers that takes a tensor of dimensions \(1\times8\) as input and outputs a tensor of dimensions \(1\times1\).
  • Use any output dimension for the first layer you want.