1. Belajar
  2. /
  3. Kursus
  4. /
  5. Scalable AI Models with PyTorch Lightning

Connected

Latihan

Implementing the validation step

Once we trained a neural network model we need to monitor its performance during training. Using PyTorch Lightning, implement the validation_step() method to calculate and log the validation loss at each epoch.

Instruksi

100 XP
  • Compute predictions using the model on input batch.
  • Calculate validation loss using F.cross_entropy().
  • Log the validation loss with self.log() as val_loss.