Skip to main content

base

superduper.vector_search.base

Source code

cosine​

cosine(x,
y)
ParameterDescription
xnumpy.ndarray
ynumpy.ndarray, y should be normalized!

Cosine similarity function for vector search.

dot​

dot(x,
y)
ParameterDescription
xnumpy.ndarray
ynumpy.ndarray

Dot function for vector similarity search.

l2​

l2(x,
y)
ParameterDescription
xnumpy.ndarray
ynumpy.ndarray

L2 function for vector similarity search.

VectorItem​

VectorItem(self,
id: 'str',
vector: 'numpy.ndarray') -> None
ParameterDescription
idID of the vector
vectorVector of the item

Class for representing a vector in vector search with id and vector.

BaseVectorSearcher​

BaseVectorSearcher(self,
identifier: 'str',
dimensions: 'int',
h: 't.Optional[numpy.ndarray]' = None,
index: 't.Optional[t.List[str]]' = None,
measure: 't.Optional[str]' = None)
ParameterDescription
identifierUnique string identifier of index
dimensionsDimension of the vector embeddings
hSeed vectors numpy.ndarray
indexlist of IDs
measuremeasure to assess similarity

Base class for vector searchers.