Skip to content

Commit

Permalink
Avoid ImageNet-C evaluation every epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
normster committed Oct 14, 2020
1 parent 5f44213 commit 9b9824c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions imagenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,11 @@ def main():
'{:.2f}'
.format((epoch + 1), train_loss_ema, test_loss, 100. * test_acc1))

corruption_accs = test_c(net, test_transform)
for c in CORRUPTIONS:
print('\t'.join(map(str, [c] + corruption_accs[c])))
corruption_accs = test_c(net, test_transform)
for c in CORRUPTIONS:
print('\t'.join(map(str, [c] + corruption_accs[c])))

print('mCE (normalized by AlexNet):', compute_mce(corruption_accs))
print('mCE (normalized by AlexNet):', compute_mce(corruption_accs))


if __name__ == '__main__':
Expand Down

0 comments on commit 9b9824c

Please sign in to comment.