From bc3240d78f4acff4f1357f67f8cc510bf91ffc83 Mon Sep 17 00:00:00 2001 From: Neea Date: Wed, 20 Dec 2023 20:39:49 -0500 Subject: [PATCH] score output* --- exp/scoring.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exp/scoring.py b/exp/scoring.py index 837421d..57a1094 100644 --- a/exp/scoring.py +++ b/exp/scoring.py @@ -85,6 +85,10 @@ class AvgList(list): def avg(self): return sdiv(sum(self), len(self)) + @property + def abs_avg(self): + return sdiv(sum(self), len(self), mult=False) + def to_dict(self): return [round(x, 6) for x in list(self)] @@ -118,4 +122,4 @@ def log(self): logd('Valid', self.n_valid.avg, self.n_records.avg) logd('Valid Evasions', self.n_valid_evades.avg, self.n_records.avg) - log('Attack Duration', f'{dur_sec(self.dur.avg) :.2f} s') + log('Attack Duration', f'{dur_sec(self.dur.abs_avg) :.2f} s')