1. Learn
  2. /
  3. Courses
  4. /
  5. Scalable AI Models with PyTorch Lightning

Connected

Exercise

Mastering the init method

In PyTorch Lightning, the __init__ method is the heart of your LightningModule setup. It's where you define model layers, parameters, and any initial configuration before training. By cleanly separating this setup step, PyTorch Lightning makes it easier to maintain and scale your projects. In this exercise, you'll focus on initializing the class for your classification model.

Instructions

100 XP
  • Create a class named ClassifierModel that inherits from pl.LightningModule.
  • Initialize the parent class to leverage LightningModule's capabilities.