Skip to content

TPU index is a package for fast similarity search over large collections of high dimension vectors on TPUs

Notifications You must be signed in to change notification settings

srihari-humbarwadi/tpu_index

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TPU Index

TPU Index is a package for fast similarity search over large collections of high dimension vectors on TPUs. This package was built to support our project that we developed for https://tfworld.devpost.com/.

Link to our project: https://devpost.com/software/naturallanguagerecommendations

Installation

!pip install tpu-index

Basic usage

from tpu_index import TPUIndex

index = TPUIndex(num_tpu_cores=8)
index.create_index(vectors)  # vectors = numpy array, shape == [None, None]

...
D, I = index.search(xq, distance_metric='cosine', top_k=5)

ToDo:

  • Add more distance metrics
  • Optional GPU support

About

TPU index is a package for fast similarity search over large collections of high dimension vectors on TPUs

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages