1. Learn
  2. /
  3. Courses
  4. /
  5. Efficient AI Model Training with PyTorch

Connected

Exercise

Logging evaluation metrics

Tracking performance metrics allows you to monitor degradations, and you can make decisions about when to update your model to maintain a high level of accuracy. You decide you will log metrics after your model finishes an evaluation loop.

Some data has been pre-loaded:

  • accelerator is an instance of Accelerator
  • eval_metric is a dictionary of metrics like accuracy and f1
  • num_epochs is the number of epochs

Instructions

100 XP
  • Call a method to log evaluation metrics of the model.
  • Log "accuracy" and "f1" score as evaluation metrics.
  • Track the epoch number using epoch of the training loop.