from utils.utils import AverageMeter accuracy = AverageMeter()
accuracy.update(75)
average_accuracy = accuracy.avg
accuracy.reset()In the above examples, we can see how easy it is to use the AverageMeter class for computing average accuracy of a model in deep learning experiments. We use the update method to update the accuracy value for each batch of data and then compute the average accuracy using the avg method. Finally, we can reset the AverageMeter to start collecting new statistics for a new training run. Package Library: PyTorch.