Browse Source

add rank pos

linfan 1 year ago
parent
commit
d3cc0c6cd3
1 changed files with 6 additions and 1 deletions
  1. 6 1
      video_rank.py

+ 6 - 1
video_rank.py

@@ -973,13 +973,18 @@ def video_sank_pos_rank(data, size, top_K, flow_pool_P, ab_Code='', exp_config=N
     if exp_config and 'recall_num_limit' in exp_config:
         recall_num_limit_dict = exp_config['recall_num_limit']
     exp_recall_dict = {}
+    index_pos = 0
     for j in range(3):
         if len(rov_recall_rank)>12:
             break
+        # choose pos
         for recall_pos_config in recall_list:
             rand_num = random.random()
-            #print("rand_num:", rand_num)
+            index_pos +=1
+            # choose pos recall
             for per_recall_item in recall_pos_config:
+                if index_pos >= len(rov_recall_rank):
+                    break
                 per_recall_name = per_recall_item[0]
                 per_recall_freq = per_recall_item[1]
                 per_recall_num = exp_recall_dict.get(per_recall_name, 0)