Realm

oa::ml::metric::RegressionErrors

Additive error moments behind MAE and RMSE. One batch observation computes both numerators on the device and reads them back together — the same once-per-evaluation-batch host boundary the loss scalar uses. MAE is sum|e| / samples; RMSE squares the mean only at observation time, so partitioned merges stay exact. Empty denominators report NaN.

StRust public API

Declaration

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

Public Methods

pub fn update(&mut self, absolute_sum: f64, squared_sum: f64, samples: u64)
pub fn update_device( &mut self, prediction: &Matrix, target: &Matrix, ) -> Result<()>
pub fn merge(&mut self, other: &Self)
pub fn mae(&self) -> f64
pub fn rmse(&self) -> f64
pub const fn samples(&self) -> u64
pub fn reset(&mut self)
fn clone(&self) -> RegressionErrors
fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn eq(&self, other: &RegressionErrors) -> bool

Associated Functions

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

Public Method Documentation

pub fn update( &mut self, absolute_sum: f64, squared_sum: f64, samples: u64 )
No public source comment is attached to this declaration.
pub fn update_device( &mut self, prediction: &Matrix, target: &Matrix, ) -> Result<()>
No public source comment is attached to this declaration.
pub fn merge( &mut self, other: &Self )
No public source comment is attached to this declaration.
pub fn mae( &self ) -> f64
No public source comment is attached to this declaration.
pub fn rmse( &self ) -> f64
No public source comment is attached to this declaration.
pub const fn samples( &self ) -> u64
No public source comment is attached to this declaration.
pub fn reset( &mut self )
No public source comment is attached to this declaration.
fn clone( &self ) -> RegressionErrors
No public source comment is attached to this declaration.
fn fmt( &self, f: &mut Formatter<'_> ) -> Result
No public source comment is attached to this declaration.
fn eq( &self, other: &RegressionErrors ) -> bool
No public source comment is attached to this declaration.
pub fn new() -> Self
No public source comment is attached to this declaration.
fn default() -> RegressionErrors
No public source comment is attached to this declaration.