We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2 occurences of feature_list should be dataset instead, also 2048 should be 100. These are defined earlier in
feature_list
dataset
num_items = 100000 num_dimensions = 100 dataset = np.random.randn(num_items, num_dimensions) dataset /= np.linalg.norm(dataset, axis=1).reshape(-1, 1)
annoy_training_time = [] annoy_test_time = [] annoy_trees = [ 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300 ] for num_trees in annoy_trees: t = AnnoyIndex(2048) # Length of item vector that will be indexed for i in range(num_images): feature = feature_list[i] t.add_item(i, feature) start_time = time.time() t.build(num_trees) #50 trees end_time = time.time() annoy_training_time.append(end_time - start_time) start_time = time.time() indices = t.get_nns_by_vector(feature_list[random_image_index], 5, include_distances=True) end_time = time.time() annoy_test_time.append(end_time - start_time) print("For number of trees = ", num_trees, ",\tTime to train = ", annoy_training_time[-1], ",\tTime to test = ", annoy_test_time[-1])
The text was updated successfully, but these errors were encountered:
No branches or pull requests
2 occurences of
feature_list
should bedataset
instead, also 2048 should be 100.These are defined earlier in
The text was updated successfully, but these errors were encountered: