pub struct ProductQuantizer<S: Store> { /* private fields */ }Expand description
Source-bound persisted product-quantization sidecar.
Implementations§
Source§impl<S> ProductQuantizer<S>
impl<S> ProductQuantizer<S>
Sourcepub fn build(
map: &ProximityMap<S>,
config: ProductQuantizationConfig,
parallelism: BuildParallelism,
) -> Result<(Self, ProductQuantizationBuildStats), Error>
pub fn build( map: &ProximityMap<S>, config: ProductQuantizationConfig, parallelism: BuildParallelism, ) -> Result<(Self, ProductQuantizationBuildStats), Error>
Train in key order, persist encoded vectors, and publish the manifest last.
Sourcepub fn load(store: S, manifest: Cid) -> Result<Self, Error>
pub fn load(store: S, manifest: Cid) -> Result<Self, Error>
Load and validate a persisted PQ manifest and its encoded-vector root.
pub fn manifest_cid(&self) -> &Cid
pub fn source_descriptor(&self) -> &Cid
pub fn config(&self) -> &ProductQuantizationConfig
pub fn quality(&self) -> ProductQuantizationQuality
Sourcepub fn search(
&self,
map: &ProximityMap<S>,
request: SearchRequest<'_>,
) -> Result<SearchResult, Error>
pub fn search( &self, map: &ProximityMap<S>, request: SearchRequest<'_>, ) -> Result<SearchResult, Error>
Search the PQ code tree, then rerank the deterministic shortlist using full vectors.
Source§impl<S> ProductQuantizer<S>
impl<S> ProductQuantizer<S>
Sourcepub fn prove_search(
&self,
map: &ProximityMap<S>,
request: SearchRequest<'_>,
limits: &ContentGraphLimits,
) -> Result<ProximitySearchProof, Error>
pub fn prove_search( &self, map: &ProximityMap<S>, request: SearchRequest<'_>, limits: &ContentGraphLimits, ) -> Result<ProximitySearchProof, Error>
Prove source-bound product-quantized execution and full reranking.
Auto Trait Implementations§
impl<S> !Freeze for ProductQuantizer<S>
impl<S> RefUnwindSafe for ProductQuantizer<S>where
S: RefUnwindSafe,
impl<S> Send for ProductQuantizer<S>
impl<S> Sync for ProductQuantizer<S>
impl<S> Unpin for ProductQuantizer<S>where
S: Unpin,
impl<S> UnsafeUnpin for ProductQuantizer<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for ProductQuantizer<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more