1. Learn
  2. /
  3. Courses
  4. /
  5. Deep Learning for Images with PyTorch

Connected

Exercise

Creating a sequential block

You decided to redesign your binary CNN model template by creating a block of convolutional layers. This will help you stack multiple layers sequentially. With this improved model, you will be able to easily design various CNN architectures.

torch and torch.nn as nn have been imported.

Instructions

100 XP
  • In the __init__() method, define a block of convolutional layers and assign it to self.conv_block.
  • In the forward() pass, pass the inputs through the convolutional block you defined.