pub struct CheckpointManager {
pub checkpoint_dir: PathBuf,
pub format: CheckpointFormat,
pub max_checkpoints: Option<usize>,
pub naming_pattern: String,
}Expand description
Checkpoint manager for saving and loading model states
Fields§
§checkpoint_dir: PathBufBase directory for checkpoints
format: CheckpointFormatDefault checkpoint format
max_checkpoints: Option<usize>Maximum number of checkpoints to keep
naming_pattern: StringCheckpoint naming pattern
Implementations§
Source§impl CheckpointManager
impl CheckpointManager
Sourcepub fn new<P: AsRef<Path>>(checkpoint_dir: P) -> NeuralResult<Self>
pub fn new<P: AsRef<Path>>(checkpoint_dir: P) -> NeuralResult<Self>
Create new checkpoint manager
Sourcepub fn with_format(self, format: CheckpointFormat) -> Self
pub fn with_format(self, format: CheckpointFormat) -> Self
Set checkpoint format
Sourcepub fn with_max_checkpoints(self, max_checkpoints: Option<usize>) -> Self
pub fn with_max_checkpoints(self, max_checkpoints: Option<usize>) -> Self
Set maximum number of checkpoints to keep
Sourcepub fn with_naming_pattern(self, pattern: String) -> Self
pub fn with_naming_pattern(self, pattern: String) -> Self
Set naming pattern
Sourcepub fn list_checkpoints(&self) -> NeuralResult<Vec<PathBuf>>
pub fn list_checkpoints(&self) -> NeuralResult<Vec<PathBuf>>
List available checkpoints
Sourcepub fn get_latest_checkpoint(&self) -> NeuralResult<Option<PathBuf>>
pub fn get_latest_checkpoint(&self) -> NeuralResult<Option<PathBuf>>
Get latest checkpoint
Auto Trait Implementations§
impl Freeze for CheckpointManager
impl RefUnwindSafe for CheckpointManager
impl Send for CheckpointManager
impl Sync for CheckpointManager
impl Unpin for CheckpointManager
impl UnsafeUnpin for CheckpointManager
impl UnwindSafe for CheckpointManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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