fast_knn_gpu icon indicating copy to clipboard operation
fast_knn_gpu copied to clipboard

how do you calculate knn(gpu)?

Open VCCIV opened this issue 6 years ago • 0 comments

why the value pred is the knn prediction in your code? normalized_keys = l2_normalize(x_keys, dim=1) normalized_query = l2_normalize(x_queries, dim=1) query_result = T.dot(normalized_keys, normalized_query.T) pred = T.argmax(query_result, axis=0)

Declare the knn function

knn = theano.function(inputs=[x_keys, x_queries], outputs=pred)

thanks

VCCIV avatar May 22 '19 14:05 VCCIV