Compare commits
3 Commits
a0a25f291c
...
aead4df707
Author | SHA1 | Date | |
---|---|---|---|
aead4df707 | |||
0b66220df4 | |||
8fa5bdad35 |
@ -35,8 +35,8 @@ parser = argparse.ArgumentParser()
|
||||
|
||||
# general setting
|
||||
parser.add_argument('--data_path', default="datasets", type=str, nargs='?', help='path to the image dataset (datasets or datasets/ILSVRC/Data/CLS-LOC)')
|
||||
parser.add_argument('--seed', default=111, type=int, help='random seed')
|
||||
parser.add_argument('--device', default="cuda:1", type=str, nargs='?', help='setup device (cpu, mps or cuda)')
|
||||
parser.add_argument('--seed', default=0, type=int, help='random seed')
|
||||
parser.add_argument('--device', default="cuda", type=str, nargs='?', help='setup device (cpu, mps or cuda)')
|
||||
parser.add_argument('--repeats', default=32, type=int, nargs='?', help='times of calculating the training-free metric')
|
||||
parser.add_argument('--input_samples', default=16, type=int, nargs='?', help='input batch size for training-free metric')
|
||||
|
||||
@ -93,11 +93,14 @@ if __name__ == "__main__":
|
||||
print(f'Average SWAP score: {np.mean(swap_score)}')
|
||||
print(f'Elapsed time: {end_time - start_time:.2f} seconds')
|
||||
|
||||
results.append([np.mean(swap_score), acc])
|
||||
results.append([np.mean(swap_score), acc, i])
|
||||
|
||||
results = pd.DataFrame(results, columns=['swap_score', 'valid_acc', 'index'])
|
||||
|
||||
results = pd.DataFrame(results, columns=['swap_score', 'valid_acc'])
|
||||
print()
|
||||
print(f'Spearman\'s Correlation Coefficient: {stats.spearmanr(results.swap_score, results.valid_acc)[0]}')
|
||||
results.to_csv('swap_results.csv', float_format='%.4f', index=False)
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user