From 96cc28b43932927ec050e8baf960443184b78223 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 17 Jul 2023 14:12:52 +0200 Subject: [PATCH] Update Classify `fitness` definition to mean of top1, top5 (#3789) --- ultralytics/utils/metrics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ultralytics/utils/metrics.py b/ultralytics/utils/metrics.py index cdf9331319..196be69a89 100644 --- a/ultralytics/utils/metrics.py +++ b/ultralytics/utils/metrics.py @@ -963,8 +963,8 @@ class ClassifyMetrics(SimpleClass): @property def fitness(self): - """Returns top-5 accuracy as fitness score.""" - return self.top5 + """Returns mean of top-1 and top-5 accuracies as fitness score.""" + return (self.top1 + self.top5) / 2 @property def results_dict(self):