pub struct FloatScannModel {
pub routing: FloatRoutingTree,
pub codebook: AhCodebook,
/* private fields */
}Expand description
Executable float ScaNN model shared by all immutable segments in one index generation.
Fields§
§routing: FloatRoutingTree§codebook: AhCodebookImplementations§
Source§impl FloatScannModel
impl FloatScannModel
Sourcepub fn from_artifact(artifact: &ScannTrainedArtifact) -> ScannResult<Self>
pub fn from_artifact(artifact: &ScannTrainedArtifact) -> ScannResult<Self>
Reconstruct the executable float model from a validated persisted generation. The anisotropic threshold is an implementation invariant, not a schema or artifact knob, so version 1 artifacts use the same hardcoded value as training.
pub fn train( data: &[f32], points: usize, dimension: usize, level_counts: &[u32], dimensions_per_block: usize, iterations: usize, seed: u64, anisotropic_threshold: f32, ) -> ScannResult<(Self, Vec<EncodedFloatVector>)>
Sourcepub fn train_model(
data: &[f32],
points: usize,
dimension: usize,
level_counts: &[u32],
dimensions_per_block: usize,
iterations: usize,
seed: u64,
anisotropic_threshold: f32,
) -> ScannResult<Self>
pub fn train_model( data: &[f32], points: usize, dimension: usize, level_counts: &[u32], dimensions_per_block: usize, iterations: usize, seed: u64, anisotropic_threshold: f32, ) -> ScannResult<Self>
Train only the index-global model. Production generation training uses this path because training-sample encodings are immediately discarded; immutable segment builders encode the actual corpus later.
pub fn encode(&self, vector: &[f32]) -> ScannResult<EncodedFloatVector>
pub fn encode_with_scratch<'a>( &self, vector: &[f32], scratch: &'a mut FloatEncodeScratch, ) -> ScannResult<(u32, &'a [u8])>
pub fn prepare_query( &self, query: &[f32], probes: usize, ) -> ScannResult<FloatScannQuery>
pub fn anisotropic_threshold(&self) -> f32
Trait Implementations§
Source§impl Clone for FloatScannModel
impl Clone for FloatScannModel
Source§fn clone(&self) -> FloatScannModel
fn clone(&self) -> FloatScannModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FloatScannModel
impl Debug for FloatScannModel
Source§impl PartialEq for FloatScannModel
impl PartialEq for FloatScannModel
impl StructuralPartialEq for FloatScannModel
Auto Trait Implementations§
impl Freeze for FloatScannModel
impl RefUnwindSafe for FloatScannModel
impl Send for FloatScannModel
impl Sync for FloatScannModel
impl Unpin for FloatScannModel
impl UnsafeUnpin for FloatScannModel
impl UnwindSafe for FloatScannModel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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