pub struct TrainingLog { /* private fields */ }Expand description
Records per-epoch training metrics.
Implementations§
Source§impl TrainingLog
impl TrainingLog
Sourcepub fn get_metric_history(&self, name: &str) -> Vec<f32>
pub fn get_metric_history(&self, name: &str) -> Vec<f32>
Extract the history of a single metric across all epochs.
Epochs that did not record the metric are skipped.
Sourcepub fn num_epochs(&self) -> usize
pub fn num_epochs(&self) -> usize
Number of epochs logged so far.
Sourcepub fn to_csv(&self) -> String
pub fn to_csv(&self) -> String
Export the log as a CSV string.
The header row contains the union of all metric names across every epoch, sorted alphabetically for deterministic output. Missing values are empty.
Sourcepub fn to_jsonl(&self) -> String
pub fn to_jsonl(&self) -> String
Export the log as JSONL (one JSON object per epoch).
Compatible with TensorBoard’s --logdir when saved as .jsonl.
Each line: {"epoch": N, "loss": 0.5, "accuracy": 0.9, ...}
Sourcepub fn save_jsonl(&self, path: &Path) -> Result<()>
pub fn save_jsonl(&self, path: &Path) -> Result<()>
Write the log to a JSONL file (append-friendly).
Trait Implementations§
Source§impl Clone for TrainingLog
impl Clone for TrainingLog
Source§fn clone(&self) -> TrainingLog
fn clone(&self) -> TrainingLog
Returns a duplicate of the value. Read more
1.0.0 · 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 TrainingLog
impl Debug for TrainingLog
Source§impl Default for TrainingLog
impl Default for TrainingLog
Source§fn default() -> TrainingLog
fn default() -> TrainingLog
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TrainingLog
impl RefUnwindSafe for TrainingLog
impl Send for TrainingLog
impl Sync for TrainingLog
impl Unpin for TrainingLog
impl UnsafeUnpin for TrainingLog
impl UnwindSafe for TrainingLog
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> 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>
Converts
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>
Converts
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