pub trait ScorerTrait: Send + Sync {
// Required methods
fn score(
&self,
vector: &ComparisonVector,
params: &ModelParams,
) -> ScoredPair;
fn estimate_params(
&self,
batch: &ComparisonBatch,
init: Option<ModelParams>,
max_iter: usize,
) -> Result<ModelParams, ZerError>;
// Provided method
fn score_batch(
&self,
batch: &ComparisonBatch,
params: &ModelParams,
) -> Vec<ScoredPair> { ... }
}Required Methods§
Sourcefn score(&self, vector: &ComparisonVector, params: &ModelParams) -> ScoredPair
fn score(&self, vector: &ComparisonVector, params: &ModelParams) -> ScoredPair
Score a single pair, always CPU, cheap dot product.
fn estimate_params( &self, batch: &ComparisonBatch, init: Option<ModelParams>, max_iter: usize, ) -> Result<ModelParams, ZerError>
Provided Methods§
Sourcefn 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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".