Skip to content
Browse files

Validation time is normalized against the amount of samples being tes…

…ted; results are therefore more accurate
  • Loading branch information...
1 parent 315feda commit 61fac9b6e41ef7fdb67c9a5bb7dc40f3ba9fd7df @mhu mhu committed
Showing with 6 additions and 0 deletions.
  1. +6 −0 utils/time_norm_va.py
View
6 utils/time_norm_va.py
@@ -93,8 +93,14 @@ def validate_norm(fn, nn, version, it):
except AssertionError:
print "\n[%s]" % norm.version, "and [%s]" % version, "don't match"
return
+ samples_amount = len([u for u in [v.examples for v in norm.patterns.values()]])
+ if samples_amount <= 0:
+ print "No samples to validate in %s" % norm.name
+ return
t = timeit.Timer("assert norm.validate() == True", "from __main__ import norm")
s = t.timeit(it)
+ # Normalize result against number of validated samples
+ s = s / float(samples_amount)
# Add result
result.add_res(norm.name, norm.version, norm.authors, s)

0 comments on commit 61fac9b

Please sign in to comment.
Something went wrong with that request. Please try again.