Skip to content

Commit

Permalink
[TEST] Increase accepted marginal error
Browse files Browse the repository at this point in the history
  • Loading branch information
leondavi committed Nov 10, 2023
1 parent 3bc9a23 commit 1ab6a91
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src_py/apiServer/experiment_flow_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from logger import *
from stats import Stats

TEST_ACCEPTABLE_MARGIN_OF_ERROR = 0.02

def print_test(in_str : str):
PREFIX = "[NERLNET-TEST] "
LOG_INFO(f"{PREFIX} {in_str}")
Expand Down Expand Up @@ -62,7 +64,7 @@ def print_test(in_str : str):

exp_stats = Stats(experiment_inst)
data = exp_stats.get_loss_min()
print("min loss of each worker")
print_test("min loss of each worker")
print(data)

conf = exp_stats.get_confusion_matrices()
Expand All @@ -73,7 +75,9 @@ def print_test(in_str : str):
for j in acc_stats[worker].keys():
diff = abs(acc_stats[worker][j]["F1"] - baseline_acc_stats[worker][str(j)]["F1"])
diff_from_baseline.append(diff/baseline_acc_stats[worker][str(j)]["F1"])
anomaly_detected = not all([x < 0.01 for x in diff_from_baseline])
anomaly_detected = not all([x < TEST_ACCEPTABLE_MARGIN_OF_ERROR for x in diff_from_baseline])
if anomaly_detected:
print_test("Anomaly failure detected")
print_test(f"diff_from_baseline: {diff_from_baseline}")
exit(1)

0 comments on commit 1ab6a91

Please sign in to comment.