pub struct ValidationMetrics {
pub validations_passed: AtomicU64,
pub validations_failed: AtomicU64,
pub relevancy_empty_rows: AtomicU64,
pub relevancy_stats: HashMap<String, F64Stats>,
pub running_aggregates: HashMap<String, Mutex<RunningAgg>>,
pub cells: Option<Arc<OpCells>>,
}Expand description
Metrics for result validation, shared across fibers.
Fields§
§validations_passed: AtomicU64§validations_failed: AtomicU64§relevancy_empty_rows: AtomicU64Scored cycles whose ground-truth row held no neighbor at all
(every entry within k a sentinel). Such a row has no
attainable recall, so it adds nothing to recall_attainable;
this counts how many there were.
relevancy_stats: HashMap<String, F64Stats>Per-function lossless f64 statistics accumulators for relevancy scores. Exact precision — no quantization, no bucket rounding.
running_aggregates: HashMap<String, Mutex<RunningAgg>>Live aggregates (moving-window + all-time) per relevancy metric. These read non-destructively, so progress views can sample them every frame without disturbing the exact-precision stats above.
cells: Option<Arc<OpCells>>The cells the same measurements are also recorded in, when the
op places them by dimension (cell: on the op). None on a
cell’s own metrics and on an op that declares no placement.
Implementations§
Source§impl ValidationMetrics
impl ValidationMetrics
Sourcepub fn new(
labels: &Labels,
functions: &[RelevancyFn],
k: usize,
r: Option<usize>,
) -> Self
pub fn new( labels: &Labels, functions: &[RelevancyFn], k: usize, r: Option<usize>, ) -> Self
Create metrics for the given relevancy functions.
The metric family name is the bare function name
(recall, precision, f1, …) — k and r are
carried as labels rather than baked into the
family identifier. This collapses every per-k
variant into a single family that consumers can
query with recall{k="10",r="10"} instead of the
awkward recall_at_10 synthesised name. r
defaults to k when the relevancy config doesn’t
declare it (r: was unset → first-k semantics).
Sourcepub fn assertions_only() -> Self
pub fn assertions_only() -> Self
Create metrics with no relevancy functions (assertions only).
Sourcepub fn record_relevancy(&self, metric_name: &str, score: f64)
pub fn record_relevancy(&self, metric_name: &str, score: f64)
Record a relevancy score for a named function. Updates both the lossless stats accumulator and the live running aggregate.
Sourcepub fn live_snapshot(&self) -> Vec<RelevancyLive>
pub fn live_snapshot(&self) -> Vec<RelevancyLive>
Snapshot all live relevancy aggregates without disturbing the accumulators. Safe to call every frame from the progress thread.
Sourcepub fn empty_rows(&self) -> u64
pub fn empty_rows(&self) -> u64
Scored cycles whose ground-truth row held no neighbor.
Auto Trait Implementations§
impl !Freeze for ValidationMetrics
impl Forget for ValidationMetrics
impl Move for ValidationMetrics
impl RefUnwindSafe for ValidationMetricswhere
Atomic<u64>: RefUnwindSafe,
Atomic<usize>: RefUnwindSafe,
Mutex<Vec<f64>>: RefUnwindSafe,
Mutex<RunningAgg>: RefUnwindSafe,
RwLock<Component>: RefUnwindSafe,
OnceLock<RelevancyShape>: RefUnwindSafe,
Mutex<HashMap<String, Arc<OpCell>>>: RefUnwindSafe,
impl Send for ValidationMetrics
impl Sync for ValidationMetrics
impl Unpin for ValidationMetrics
impl UnsafeUnpin for ValidationMetricswhere
Align8<u64>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(String, F64Stats)>: UnsafeUnpin,
PhantomData<(String, Mutex<RunningAgg>)>: UnsafeUnpin,
*const ArcInner<OpCells> is !null: UnsafeUnpin,
PhantomData<ArcInner<OpCells>>: UnsafeUnpin,
impl UnwindSafe for ValidationMetricswhere
Align8<u64>: UnwindSafe,
HashMap<String, F64Stats>: UnwindSafe,
HashMap<String, Mutex<RunningAgg>>: UnwindSafe,
Arc<OpCells>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more