Skip to content

Commit

Permalink
remove some code
Browse files Browse the repository at this point in the history
  • Loading branch information
gyzhou2000 committed Jul 4, 2024
1 parent 9b50cd2 commit 83db1e0
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions examples/dna/dna_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ def main(args):
test_y = tlx.gather(data['y'], data['test_idx'])
test_acc = calculate_acc(test_logits, test_y, metrics)
print("Test acc: {:.4f}".format(test_acc))
return test_acc


if __name__ == '__main__':
Expand All @@ -142,15 +141,4 @@ def main(args):
else:
tlx.set_device("CPU")

# main(args)

test_accs = []
for i in range(5):
print(f"Run {i+1}:")
test_acc = main(args)
test_accs.append(test_acc)

mean_test_acc = np.mean(test_accs)
std_test_acc = np.std(test_accs)
print(f"Mean Test Accuracy: {mean_test_acc:.4f}")
print(f"Standard Deviation of Test Accuracy: {std_test_acc:.4f}")
main(args)

0 comments on commit 83db1e0

Please sign in to comment.