Skip to main content

OnlineBitPredictor

Trait OnlineBitPredictor 

Source
pub trait OnlineBitPredictor {
    // Required methods
    fn bit_prediction(&mut self) -> BinaryPrediction;
    fn update_bit(&mut self, bit: bool);

    // Provided methods
    fn begin_bit_stream(
        &mut self,
        _total_bits: Option<u64>,
        _semantics: BitStreamSemantics,
    ) -> Result<(), String> { ... }
    fn finish_bit_stream(&mut self) -> Result<(), String> { ... }
    fn update_bit_frozen(&mut self, bit: bool) { ... }
}
Expand description

Minimal bit predictor interface for true binary consumers.

Required Methods§

Source

fn bit_prediction(&mut self) -> BinaryPrediction

Predict the next bit without updating state.

Source

fn update_bit(&mut self, bit: bool)

Observe a bit while fitting/adapting.

Provided Methods§

Source

fn begin_bit_stream( &mut self, _total_bits: Option<u64>, _semantics: BitStreamSemantics, ) -> Result<(), String>

Optional stream-start hook.

Source

fn finish_bit_stream(&mut self) -> Result<(), String>

Optional stream-finalization hook.

Source

fn update_bit_frozen(&mut self, bit: bool)

Observe a bit as conditioning only.

Implementors§