pub struct Scorer { /* private fields */ }Expand description
Fellegi-Sunter scorer with automatic GPU/CPU EM acceleration.
score / score_batch always run on CPU, no kernel overhead for small
operations. estimate_params uses the GPU EM kernel when the backend is
GPU and the batch exceeds the transfer break-even threshold; otherwise it
falls back to zer_compare::run_em on the CPU.
Implementations§
Trait Implementations§
Source§impl Scorer for Scorer
impl Scorer for Scorer
Source§fn score(&self, vector: &ComparisonVector, params: &ModelParams) -> ScoredPair
fn score(&self, vector: &ComparisonVector, params: &ModelParams) -> ScoredPair
Score a single pair, always CPU, cheap dot product.
Source§fn score_batch(
&self,
batch: &ComparisonBatch,
params: &ModelParams,
) -> Vec<ScoredPair>
fn score_batch( &self, batch: &ComparisonBatch, params: &ModelParams, ) -> Vec<ScoredPair>
Score a batch using the field-major
ComparisonBatch.fn estimate_params( &self, batch: &ComparisonBatch, init: Option<ModelParams>, max_iter: usize, ) -> ZerResult<ModelParams>
Auto Trait Implementations§
impl Freeze for Scorer
impl RefUnwindSafe for Scorer
impl Send for Scorer
impl Sync for Scorer
impl Unpin for Scorer
impl UnsafeUnpin for Scorer
impl UnwindSafe for Scorer
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