Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Karan Desai committed Jul 26, 2018
1 parent 9421bc9 commit 0cef773
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Performance on `v1.0` val (trained on `v1.0` train):

| R@1 | R@5 | R@10 | MeanR | MRR |
| ------ | ------ | ------ | ------ | ------ |
| 0.4194 | 0.7345 | 0.8387 | 5.9876 | 0.5650 |
| 0.4298 | 0.7464 | 0.8491 | 5.4874 | 0.5757 |


Acknowledgements
Expand Down
8 changes: 1 addition & 7 deletions utils/eval_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@

def get_gt_ranks(ranks, ans_ind):
ans_ind = ans_ind.view(-1)
num_opts = 100
ranks = ranks.view(-1, num_opts)
gt_ranks = torch.LongTensor(ans_ind.size(0))
for i in range(ans_ind.size(0)):
gt_binary = torch.zeros(num_opts)
gt_binary[ans_ind[i]] = 1
sorted_gt = gt_binary.index_select(0, ranks[i].sort()[1].cpu())
gt_rank = (sorted_gt == 1).nonzero() + 1
gt_ranks[i] = int(gt_rank) # gt_rank is 1x1 LongTensor
gt_ranks[i] = int(ranks[i, ans_ind[i]])
return gt_ranks


Expand Down

0 comments on commit 0cef773

Please sign in to comment.