Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
score output*
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrusch committed Dec 21, 2023
1 parent f66a3bc commit bc3240d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion exp/scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]

Expand Down Expand Up @@ -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')

0 comments on commit bc3240d

Please sign in to comment.