1. 学习
  2. /
  3. 课程
  4. /
  5. Scalable AI Models with PyTorch Lightning

Connected

练习

Evaluate model accuracy using Torchmetrics

Evaluating how well your model performs is essential - especially when preparing it for deployment! Let's smoothly integrate accuracy calculation using Torchmetrics right into the validation_step(). Don't forget to log the results, so you can easily monitor your model's progress.

说明

100 XP
  • Import Accuracy from torchmetrics.
  • Instantiate the accuracy metric inside __init__().
  • Calculate accuracy within validation_step() and log it as 'val_acc'.