Skip to content

Commit

Permalink
Merge pull request #1 from yaolubrain/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
wangg12 committed Nov 28, 2015
2 parents 203cd84 + c0177ea commit a344b67
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion imagenet_zero_shot_unseen_wnids.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
imagenet_21k = open('imagenet.synset.obtain_synset_list', 'r').read().splitlines()

imagenet_1k = open('distance_mat_wordnet_nodes_1K.txt', 'r').read().splitlines()
idx_list = open('imagenet_zero_shot_unseen_wnids.txt', 'w')

Expand Down
2 changes: 1 addition & 1 deletion zero_shot_ica.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
print 0, 0,


#mixed
# mixed
class_idx = wnid2idx_mixed[wnid]
D = cdist(P1g, PW23, 'cosine')
pred_20 = np.argsort(D, axis=1)[:,:20]
Expand Down
4 changes: 2 additions & 2 deletions zero_shot_pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
im_num = output.shape[0]
wnid = f[0:9]

# unseen
# unseen
if wnid2idx_unseen.has_key(wnid):
class_idx = wnid2idx_unseen[wnid]
D = cdist(P1g, PW3, 'cosine')
Expand All @@ -72,7 +72,7 @@
print 0, 0,


# all
# mixed
class_idx = wnid2idx_mixed[wnid]
D = cdist(P1g, PW23, 'cosine')
pred_20 = np.argsort(D, axis=1)[:,:20]
Expand Down
4 changes: 2 additions & 2 deletions zero_shot_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
im_num = output.shape[0]
wnid = f[0:9]

# unseen
# unseen
if wnid2idx_unseen.has_key(wnid):
class_idx = wnid2idx_unseen[wnid]
D = cdist(P1g, PW3, 'cosine')
Expand All @@ -71,7 +71,7 @@
print 0, 0,


# all
# mixed
class_idx = wnid2idx_mixed[wnid]
D = cdist(P1g, PW23, 'cosine')
pred_20 = np.argsort(D, axis=1)[:,:20]
Expand Down

0 comments on commit a344b67

Please sign in to comment.