1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Error types for training operations.
use thiserror::Error;
/// Errors that can occur during training.
#[derive(Error, Debug)]
pub enum TrainError {
/// Error in loss computation.
#[error("Loss computation error: {0}")]
LossError(String),
/// Error in optimizer operation.
#[error("Optimizer error: {0}")]
OptimizerError(String),
/// Error in batch processing.
#[error("Batch processing error: {0}")]
BatchError(String),
/// Error in callback execution.
#[error("Callback error: {0}")]
CallbackError(String),
/// Error in metrics computation.
#[error("Metrics error: {0}")]
MetricsError(String),
/// Error in checkpoint save/load.
#[error("Checkpoint error: {0}")]
CheckpointError(String),
/// Error with invalid parameter.
#[error("Invalid parameter: {0}")]
InvalidParameter(String),
/// Error in model operations.
#[error("Model error: {0}")]
ModelError(String),
/// Error in configuration.
#[error("Configuration error: {0}")]
ConfigError(String),
/// Error from tensorlogic-infer.
#[error("Executor error: {0}")]
ExecutorError(#[from] tensorlogic_infer::ExecutorError),
/// Generic error.
#[error("{0}")]
Other(String),
}
/// Result type for training operations.
pub type TrainResult<T> = Result<T, TrainError>;