reduce logging. actual training
This commit is contained in:
@@ -503,9 +503,21 @@ class TradingOrchestrator:
|
||||
}
|
||||
|
||||
# ENHANCED: Real-time Training System Integration
|
||||
self.enhanced_training_system = (
|
||||
None # Will be set to EnhancedRealtimeTrainingSystem if available
|
||||
)
|
||||
self.enhanced_training_system = None
|
||||
if ENHANCED_TRAINING_AVAILABLE:
|
||||
try:
|
||||
self.enhanced_training_system = EnhancedRealtimeTrainingSystem(
|
||||
orchestrator=self,
|
||||
data_provider=self.data_provider,
|
||||
dashboard=None # Optional dashboard integration
|
||||
)
|
||||
logger.info("EnhancedRealtimeTrainingSystem initialized successfully")
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to initialize EnhancedRealtimeTrainingSystem: {e}")
|
||||
self.enhanced_training_system = None
|
||||
else:
|
||||
logger.warning("EnhancedRealtimeTrainingSystem not available")
|
||||
|
||||
# Enable training by default - don't depend on external training system
|
||||
self.training_enabled: bool = enhanced_rl_training
|
||||
|
||||
@@ -1162,6 +1174,49 @@ class TradingOrchestrator:
|
||||
logger.info(
|
||||
f"Synced {model_name} model state: loss={stats['current_loss']:.4f}, improvement={stats['improvement_pct']:.1f}%"
|
||||
)
|
||||
|
||||
# Live Inference & Training Methods
|
||||
def start_live_training(self) -> bool:
|
||||
"""Start live inference and training mode"""
|
||||
if self.enhanced_training_system:
|
||||
try:
|
||||
self.enhanced_training_system.start_training()
|
||||
logger.info("Live training mode started")
|
||||
return True
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to start live training: {e}")
|
||||
return False
|
||||
else:
|
||||
logger.error("Enhanced training system not available")
|
||||
return False
|
||||
|
||||
def stop_live_training(self) -> bool:
|
||||
"""Stop live inference and training mode"""
|
||||
if self.enhanced_training_system:
|
||||
try:
|
||||
self.enhanced_training_system.stop_training()
|
||||
logger.info("Live training mode stopped")
|
||||
return True
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to stop live training: {e}")
|
||||
return False
|
||||
return False
|
||||
|
||||
def is_live_training_active(self) -> bool:
|
||||
"""Check if live training is active"""
|
||||
if self.enhanced_training_system:
|
||||
return self.enhanced_training_system.is_training
|
||||
return False
|
||||
|
||||
def get_live_training_stats(self) -> Dict[str, Any]:
|
||||
"""Get live training statistics"""
|
||||
if self.enhanced_training_system and self.enhanced_training_system.is_training:
|
||||
try:
|
||||
return self.enhanced_training_system.get_model_performance_stats()
|
||||
except Exception as e:
|
||||
logger.error(f"Error getting live training stats: {e}")
|
||||
return {}
|
||||
return {}
|
||||
|
||||
# UNUSED FUNCTION - Not called anywhere in codebase
|
||||
def checkpoint_saved(self, model_name: str, checkpoint_data: Dict[str, Any]):
|
||||
|
||||
Reference in New Issue
Block a user