pub trait FromScore: Weight {
// Required methods
fn from_cost(cost: f32) -> Self;
fn to_cost(&self) -> f32;
}Expand description
A weight that can be built from one acoustic score.
The scores are costs, that is, negative log probabilities where smaller is
better, which is already what both the tropical and the log semiring mean by
a weight’s value. Keeping the trait rather than hard-wiring TropicalWeight
lets the same decoder run Viterbi (tropical) and forward-sum (log) without a
second implementation.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".