pub struct SkipChainCrf { /* private fields */ }Expand description
A skip-chain CRF holding the (shared) chain and skip-edge log-potentials.
Implementations§
Source§impl SkipChainCrf
impl SkipChainCrf
Sourcepub fn new(
cfg: SkipChainConfig,
transition: Vec<f64>,
skip_potential: Vec<f64>,
) -> SeqResult<Self>
pub fn new( cfg: SkipChainConfig, transition: Vec<f64>, skip_potential: Vec<f64>, ) -> SeqResult<Self>
Construct a skip-chain CRF, validating the potential shapes.
Sourcepub fn with_damping(self, damping: f64) -> SeqResult<Self>
pub fn with_damping(self, damping: f64) -> SeqResult<Self>
Override the message-passing damping factor (must be in (0, 1]).
Sourcepub fn infer_marginals(
&self,
unary: &[f64],
seq_len: usize,
skip_edges: &[(usize, usize)],
) -> SeqResult<Vec<f64>>
pub fn infer_marginals( &self, unary: &[f64], seq_len: usize, skip_edges: &[(usize, usize)], ) -> SeqResult<Vec<f64>>
Loopy sum-product BP returning per-position marginals (seq_len × n_labels,
each position normalised to sum to 1).
Trait Implementations§
Source§impl Clone for SkipChainCrf
impl Clone for SkipChainCrf
Source§fn clone(&self) -> SkipChainCrf
fn clone(&self) -> SkipChainCrf
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 moreAuto Trait Implementations§
impl Freeze for SkipChainCrf
impl RefUnwindSafe for SkipChainCrf
impl Send for SkipChainCrf
impl Sync for SkipChainCrf
impl Unpin for SkipChainCrf
impl UnsafeUnpin for SkipChainCrf
impl UnwindSafe for SkipChainCrf
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