pub struct OnlinePerplexity { /* private fields */ }Expand description
Running perplexity estimator: accumulates Σ log_p and token count, and
reports exp(-mean_neg_log_p) on demand.
Feeding tokens one at a time yields exactly the same value as the batch
crate::perplexity::PerplexityEvaluator::compute call at the end, up to
f32 accumulation order.
Implementations§
Source§impl OnlinePerplexity
impl OnlinePerplexity
Sourcepub fn push_chunk(&mut self, log_ps: &[f32])
pub fn push_chunk(&mut self, log_ps: &[f32])
Feed a chunk of log-probabilities.
Trait Implementations§
Source§impl Clone for OnlinePerplexity
impl Clone for OnlinePerplexity
Source§fn clone(&self) -> OnlinePerplexity
fn clone(&self) -> OnlinePerplexity
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 moreSource§impl Debug for OnlinePerplexity
impl Debug for OnlinePerplexity
Source§impl Default for OnlinePerplexity
impl Default for OnlinePerplexity
Source§fn default() -> OnlinePerplexity
fn default() -> OnlinePerplexity
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OnlinePerplexity
impl RefUnwindSafe for OnlinePerplexity
impl Send for OnlinePerplexity
impl Sync for OnlinePerplexity
impl Unpin for OnlinePerplexity
impl UnsafeUnpin for OnlinePerplexity
impl UnwindSafe for OnlinePerplexity
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