use super::*;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MLMappingConfig {
pub enable_ml: bool,
pub model_types: Vec<MLModelType>,
pub feature_config: FeatureConfig,
pub training_config: TrainingConfig,
pub prediction_config: PredictionConfig,
pub transfer_learning: TransferLearningConfig,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FeatureConfig {
pub enable_structural: bool,
pub enable_temporal: bool,
pub enable_hardware: bool,
pub enable_circuit: bool,
pub selection_method: FeatureSelectionMethod,
pub max_features: usize,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TrainingConfig {
pub batch_size: usize,
pub epochs: usize,
pub learning_rate: f64,
pub validation_split: f64,
pub early_stopping_patience: usize,
pub regularization: RegularizationParams,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RegularizationParams {
pub l1_lambda: f64,
pub l2_lambda: f64,
pub dropout: f64,
pub batch_norm: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PredictionConfig {
pub ensemble_size: usize,
pub confidence_threshold: f64,
pub use_uncertainty_estimation: bool,
pub monte_carlo_samples: usize,
pub temperature_scaling: bool,
pub calibration_method: CalibrationMethod,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TransferLearningConfig {
pub enable_transfer: bool,
pub source_domains: Vec<String>,
pub adaptation_method: DomainAdaptationMethod,
pub fine_tuning: FineTuningConfig,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FineTuningConfig {
pub freeze_layers: Vec<usize>,
pub unfreeze_after_epochs: usize,
pub reduced_learning_rate: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PerformancePredictions {
pub predicted_swaps: f64,
pub predicted_time: f64,
pub predicted_fidelity: f64,
pub confidence_intervals: HashMap<String, (f64, f64)>,
pub uncertainty_estimates: HashMap<String, f64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MLPerformanceResult {
pub model_accuracy: HashMap<String, f64>,
pub feature_importance: HashMap<String, f64>,
pub prediction_reliability: f64,
pub training_history: Vec<TrainingEpoch>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TrainingEpoch {
pub epoch: usize,
pub training_loss: f64,
pub validation_loss: f64,
pub learning_rate: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AdaptiveMappingInsights {
pub learning_progress: HashMap<String, f64>,
pub adaptation_effectiveness: HashMap<String, f64>,
pub performance_trends: HashMap<String, Vec<f64>>,
pub recommended_adjustments: Vec<ParameterAdjustment>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ParameterAdjustment {
pub parameter: String,
pub current_value: f64,
pub recommended_value: f64,
pub expected_improvement: f64,
pub confidence: f64,
}