Realm

oa::ml::metric::AccuracyCount

Additive correct/sample counters for categorical accuracy. Batch counts recorded through AccuracyCount::record stay device-resident in bounded groups until AccuracyCount::resolve or AccuracyCount::result observes them — the same deferred grouped readback the managed evaluation plane uses, so per-batch host synchronization never happens inside a hot loop. The result is NaN when no samples have been observed.

StRust public API

Declaration

pub struct AccuracyCount { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn record(&mut self, count: Matrix, samples: u64)
pub fn update(&mut self, correct: u64, samples: u64)
pub fn resolve(&mut self) -> Result<()>
pub fn merge(&mut self, other: &mut Self)
pub fn result(&mut self) -> Result<f64>
pub const fn counts(&self) -> (u64, u64)
pub fn has_pending(&self) -> bool
pub fn reset(&mut self)

Associated Functions

pub fn new() -> Self
fn default() -> AccuracyCount

Public Method Documentation

pub fn record( &mut self, count: Matrix, samples: u64 )
No public source comment is attached to this declaration.
pub fn update( &mut self, correct: u64, samples: u64 )
No public source comment is attached to this declaration.
pub fn resolve(&mut self) -> Result<()>
No public source comment is attached to this declaration.
pub fn merge( &mut self, other: &mut Self )
No public source comment is attached to this declaration.
pub fn result( &mut self ) -> Result<f64>
No public source comment is attached to this declaration.
pub const fn counts(&self) -> ( u64, u64 )
No public source comment is attached to this declaration.
pub fn has_pending( &self ) -> bool
No public source comment is attached to this declaration.
pub fn reset( &mut self )
No public source comment is attached to this declaration.
pub fn new() -> Self
No public source comment is attached to this declaration.
fn default() -> AccuracyCount
No public source comment is attached to this declaration.