Commit 29eae22e authored by 段英荣's avatar 段英荣

modify top_tag_list_len

parent ae9414e2
......@@ -59,8 +59,9 @@ class LinUCB:
AaI_tmp = np.array(Aa_list)
theta_tmp = np.array(theta_list)
top_tag_list_len = int(len(tag_list)/3)
top_np_ind = np.argpartition(np.dot(xaT, theta_tmp) + cls.alpha * np.sqrt(np.dot(np.dot(xaT, AaI_tmp), xa)), -top_tag_list_len)[-top_tag_list_len:]
np_array = np.dot(xaT, theta_tmp) + cls.alpha * np.sqrt(np.dot(np.dot(xaT, AaI_tmp), xa))
top_tag_list_len = int(np_array.size/2)
top_np_ind = np.argpartition(np_array, -top_tag_list_len)[-top_tag_list_len:]
top_tag_list = list()
top_np_list = top_np_ind.tolist()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment