pub struct CentroidSelector;Expand description
Phase 1: Select top centroids per query token.
For each query token, compute its similarity with all centroids and select the top-nprobe centroids above the score threshold.
Implementations§
Source§impl CentroidSelector
impl CentroidSelector
Sourcepub fn select(
query: &MultiVectorEmbedding,
centroids: &[f32],
dim: usize,
config: &WarpSearchConfig,
) -> Vec<Vec<(usize, f32)>>
pub fn select( query: &MultiVectorEmbedding, centroids: &[f32], dim: usize, config: &WarpSearchConfig, ) -> Vec<Vec<(usize, f32)>>
Select top centroids for each query token.
§Arguments
query- Query multi-vector embeddingcentroids- Flattened centroid vectors [num_centroids × dim]dim- Token embedding dimensionconfig- Search configuration
§Returns
For each query token, a vector of (centroid_id, centroid_score) pairs sorted by score descending.
Auto Trait Implementations§
impl Freeze for CentroidSelector
impl RefUnwindSafe for CentroidSelector
impl Send for CentroidSelector
impl Sync for CentroidSelector
impl Unpin for CentroidSelector
impl UnsafeUnpin for CentroidSelector
impl UnwindSafe for CentroidSelector
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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