-
Notifications
You must be signed in to change notification settings - Fork 608
Open
Labels
Milestone
Description
I have been trying to figure SPTAG out to use in my ANN searches to no avail. I am not getting an responses from the contributors, so am trying my luck with other uses. Could someone provide a simple walkthrough of how to use this tool? This is what I am stuck on:
- If i want to create a 300 dimension store, I need to a "build" first? and is this done only once?
n = 300
k = 5
r = 3
def testBuild(algo, distmethod, x, out):
i = SPTAG.AnnIndex(algo, 'Float', x.shape[1])
i.SetBuildParam("NumberOfThreads", '4')
i.SetBuildParam("DistCalcMethod", distmethod)
ret = i.Build(x, x.shape[0])
i.Save(out)
- For incremental adds, do I just use this method without overwriting previous ones:
def testAdd(index, x, out, algo, distmethod):
if index != None:
i = SPTAG.AnnIndex.Load(index)
else:
i = SPTAG.AnnIndex(algo, 'Float', x.shape[1])
i.SetBuildParam("NumberOfThreads", '4')
i.SetBuildParam("DistCalcMethod", distmethod)
if i.Add(x, x.shape[0]):
i.Save(out)
- what does the
testAddWithMetaDatado? does it return say an identifier with each result it returns? Is there a type of metadata that is supported i.e. can i save text snippets with it?
Could someone from microsoft please take a moment to provide a simple guide to using this powerful tool?
Reactions are currently unavailable