pub struct ModelCheckpoint {
pub model_type: String,
pub weights: ModelWeights,
pub optimizer_state: Option<OptimizerState>,
pub training_history: TrainingHistory,
pub current_epoch: usize,
pub metadata: CheckpointMetadata,
pub version: String,
}Expand description
Complete model checkpoint
Fields§
§model_type: StringModel architecture identifier
weights: ModelWeightsModel weights and biases
optimizer_state: Option<OptimizerState>Optimizer state
training_history: TrainingHistoryTraining history
current_epoch: usizeCurrent epoch
metadata: CheckpointMetadataCheckpoint metadata
version: StringModel version
Implementations§
Source§impl ModelCheckpoint
impl ModelCheckpoint
Sourcepub fn new(
model_type: String,
weights: ModelWeights,
current_epoch: usize,
) -> Self
pub fn new( model_type: String, weights: ModelWeights, current_epoch: usize, ) -> Self
Create new model checkpoint
Sourcepub fn with_optimizer(self, optimizer_state: OptimizerState) -> Self
pub fn with_optimizer(self, optimizer_state: OptimizerState) -> Self
Add optimizer state
Sourcepub fn with_history(self, training_history: TrainingHistory) -> Self
pub fn with_history(self, training_history: TrainingHistory) -> Self
Add training history
Sourcepub fn with_metadata(self, metadata: CheckpointMetadata) -> Self
pub fn with_metadata(self, metadata: CheckpointMetadata) -> Self
Add metadata
Sourcepub fn validate(&self) -> NeuralResult<()>
pub fn validate(&self) -> NeuralResult<()>
Validate checkpoint consistency
Trait Implementations§
Source§impl Clone for ModelCheckpoint
impl Clone for ModelCheckpoint
Source§fn clone(&self) -> ModelCheckpoint
fn clone(&self) -> ModelCheckpoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ModelCheckpoint
impl RefUnwindSafe for ModelCheckpoint
impl Send for ModelCheckpoint
impl Sync for ModelCheckpoint
impl Unpin for ModelCheckpoint
impl UnsafeUnpin for ModelCheckpoint
impl UnwindSafe for ModelCheckpoint
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> 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