MCPcopy Create free account
hub / github.com/MinishLab/vicinity / __init__

Method __init__

vicinity/backends/basic.py:213–216  ·  view source on GitHub ↗

Initialize the cosine basic backend.

(self, vectors: npt.NDArray, arguments: BasicArgs)

Source from the content-addressed store, hash-verified

211
212class CosineBasicBackend(BasicBackend):
213 def __init__(self, vectors: npt.NDArray, arguments: BasicArgs) -> None:
214 """Initialize the cosine basic backend."""
215 super().__init__(vectors=vectors, arguments=arguments)
216 self._vectors = normalize_or_copy(self._vectors)
217
218 def _dist(self, x: npt.NDArray) -> npt.NDArray:
219 """Compute cosine distance."""

Callers

nothing calls this directly

Calls 2

normalize_or_copyFunction · 0.90
__init__Method · 0.45

Tested by

no test coverage detected