const CHECKPOINT_VERSION: u32
Checkpoint format version
Source: checkpoint.joule:12
const CHECKPOINT_VERSION: u32Checkpoint format version
Source: checkpoint.joule:12
const CHECKPOINT_MAGIC: [u8; 4]Magic bytes for checkpoint files
Source: checkpoint.joule:15
struct CheckpointMetadataSource: checkpoint.joule:19
fn new(epoch: u64, global_step: u64) -> SelfSource: checkpoint.joule:31
fn with_metric(mut self, name: &str, value: f64) -> SelfSource: checkpoint.joule:44
fn with_model_name(mut self, name: &str) -> SelfSource: checkpoint.joule:50
fn with_config(mut self, key: &str, value: &str) -> SelfSource: checkpoint.joule:55
struct StateDictSource: checkpoint.joule:63
struct TensorDataSource: checkpoint.joule:69
fn from_tensor(tensor: &Tensor) -> SelfCreate from tensor
Source: checkpoint.joule:77
fn to_tensor(&self) -> TensorConvert to tensor
Source: checkpoint.joule:86
fn new() -> SelfCreate empty state dict
Source: checkpoint.joule:94
fn insert(&mut self, name: &str, tensor: &Tensor)Add a tensor
Source: checkpoint.joule:101
fn get(&self, name: &str) -> Option<Tensor>Get a tensor
Source: checkpoint.joule:106
fn keys(&self) -> impl Iterator<Item = &String>Get tensor names
Source: checkpoint.joule:111
fn len(&self) -> usizeNumber of tensors
Source: checkpoint.joule:116
struct CheckpointSource: checkpoint.joule:123
fn new(Create new checkpoint
Source: checkpoint.joule:133
fn with_optimizer(mut self, state: HashMap<String, Tensor>) -> SelfAdd optimizer state
Source: checkpoint.joule:147
fn with_scheduler(mut self, state: HashMap<String, f64>) -> SelfAdd scheduler state
Source: checkpoint.joule:153
fn with_rng_state(mut self) -> SelfAdd RNG state for reproducibility
Source: checkpoint.joule:159
fn save(&self, path: &str) -> Result<(), CheckpointError>Source: checkpoint.joule:167
fn load(path: &str) -> Result<Self, CheckpointError>Source: checkpoint.joule:190
enum CheckpointErrorSource: checkpoint.joule:226
fn from(e: std::io::Error) -> SelfSource: checkpoint.joule:235
fn from(e: serde_json::Error) -> SelfSource: checkpoint.joule:241
struct CheckpointManagerManages checkpoint saving and loading with best model tracking
Source: checkpoint.joule:251
struct CheckpointInfoSource: checkpoint.joule:263
fn new(save_dir: &str) -> SelfCreate new checkpoint manager
Source: checkpoint.joule:272
fn max_to_keep(mut self, n: usize) -> SelfSet maximum checkpoints to keep
Source: checkpoint.joule:287
fn save_best_only(mut self, metric_name: &str, mode: &str) -> SelfOnly save when metric improves
Source: checkpoint.joule:293
fn is_better(&self, metric: f64) -> boolCheck if metric improved
Source: checkpoint.joule:301
fn save(Source: checkpoint.joule:316
fn cleanup(&mut self) -> Result<(), CheckpointError>Remove old checkpoints
Source: checkpoint.joule:368
fn load_latest(&self) -> Result<Checkpoint, CheckpointError>Load latest checkpoint
Source: checkpoint.joule:379
fn load_best(&self) -> Result<Checkpoint, CheckpointError>Load best checkpoint
Source: checkpoint.joule:386
fn load_epoch(&self, epoch: u64) -> Result<Checkpoint, CheckpointError>Load checkpoint by epoch
Source: checkpoint.joule:392
fn list(&self) -> &[CheckpointInfo]List all checkpoints
Source: checkpoint.joule:400
fn scan(&mut self) -> Result<(), CheckpointError>Scan directory for existing checkpoints
Source: checkpoint.joule:405
fn get_state_dict<M: Module>(module: &M) -> StateDictExtract state dict from a module
Source: checkpoint.joule:448
fn load_state_dict<M: Module>(module: &mut M, state: &StateDict) -> Result<(), CheckpointError>Load state dict into a module
Source: checkpoint.joule:459
fn save_model<M: Module>(module: &M, path: &str) -> Result<(), CheckpointError>Source: checkpoint.joule:476
fn load_model<M: Module>(module: &mut M, path: &str) -> Result<(), CheckpointError>Source: checkpoint.joule:485
fn export_onnx<M: Module>(Source: checkpoint.joule:492
fn export_script<M: Module>(Source: checkpoint.joule:513