pub struct Trace {
pub state_before: f64,
pub state_after: f64,
pub score: f64,
pub gradient_norm: f64,
pub timestamp_ns: u128,
pub iteration: usize,
}Expand description
Trace of a single loop iteration
Fields§
§state_before: f64State before the action
state_after: f64State after the action
score: f64Performance score (lower is better)
gradient_norm: f64Gradient norm
timestamp_ns: u128Timestamp in nanoseconds
iteration: usizeIteration number
Implementations§
Source§impl Trace
impl Trace
Sourcepub fn new(
state_before: f64,
state_after: f64,
score: f64,
iteration: usize,
) -> Self
pub fn new( state_before: f64, state_after: f64, score: f64, iteration: usize, ) -> Self
Create a new trace
Sourcepub fn improvement(&self) -> f64
pub fn improvement(&self) -> f64
Calculate the improvement (positive = better)
Sourcepub fn is_progress(&self) -> bool
pub fn is_progress(&self) -> bool
Check if this represents progress
Sourcepub fn lipschitz_estimate(&self, input_delta: f64) -> f64
pub fn lipschitz_estimate(&self, input_delta: f64) -> f64
Calculate Lipschitz constant estimate
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Trace
impl<'de> Deserialize<'de> for Trace
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Trace
Auto Trait Implementations§
impl Freeze for Trace
impl RefUnwindSafe for Trace
impl Send for Trace
impl Sync for Trace
impl Unpin for Trace
impl UnwindSafe for Trace
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.