pub struct ModelPersistence;
Expand description
Model persistence operations
Implementations§
Source§impl ModelPersistence
impl ModelPersistence
Sourcepub fn save_to_json<P: AsRef<Path>>(
model: &SavedModel,
path: P,
) -> Result<(), PersistenceError>
pub fn save_to_json<P: AsRef<Path>>( model: &SavedModel, path: P, ) -> Result<(), PersistenceError>
Save model to JSON format (human-readable)
Sourcepub fn load_from_json<P: AsRef<Path>>(
path: P,
) -> Result<SavedModel, PersistenceError>
pub fn load_from_json<P: AsRef<Path>>( path: P, ) -> Result<SavedModel, PersistenceError>
Load model from JSON format
Sourcepub fn save_to_binary<P: AsRef<Path>>(
model: &SavedModel,
path: P,
) -> Result<(), PersistenceError>
pub fn save_to_binary<P: AsRef<Path>>( model: &SavedModel, path: P, ) -> Result<(), PersistenceError>
Save model to binary format (compact and fast)
Sourcepub fn load_from_binary<P: AsRef<Path>>(
path: P,
) -> Result<SavedModel, PersistenceError>
pub fn load_from_binary<P: AsRef<Path>>( path: P, ) -> Result<SavedModel, PersistenceError>
Load model from binary format
Sourcepub fn create_saved_model(
network: &LSTMNetwork,
model_name: String,
total_epochs: usize,
final_loss: Option<f64>,
description: Option<String>,
) -> SavedModel
pub fn create_saved_model( network: &LSTMNetwork, model_name: String, total_epochs: usize, final_loss: Option<f64>, description: Option<String>, ) -> SavedModel
Create a model with metadata
Auto Trait Implementations§
impl Freeze for ModelPersistence
impl RefUnwindSafe for ModelPersistence
impl Send for ModelPersistence
impl Sync for ModelPersistence
impl Unpin for ModelPersistence
impl UnwindSafe for ModelPersistence
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