1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Deep Learning with PyTorch

Exercise

Experimenting with dropout

The dropout layer randomly zeroes out elements of the input tensor. Doing so helps fight overfitting. In this exercise, you'll create a small neural network with at least two linear layers, two dropout layers, and two activation functions.

The torch.nn package has already been imported as nn. An input_tensor of dimensions \(1 \times 3072\) has been created for you.

Instructions 1/2

undefined XP
  • 1
    • Create a small neural network with one linear layer, one ReLU function, and one dropout layer, in that order.
    • The model should take input_tensor as input and return an output of size 16.
  • 2
    • Using the same neural network, set the probability of zeroing out elements in the dropout layer to 0.8.