rl model inf fix

This commit is contained in:
Dobromir Popov
2025-07-30 11:47:33 +03:00
parent 14086a898e
commit fde370fa1b
2 changed files with 2 additions and 9 deletions

View File

@ -540,7 +540,6 @@ class TradingOrchestrator:
self._initialize_decision_fusion() # Initialize fusion system
self._initialize_transformer_model() # Initialize transformer model
self._initialize_enhanced_training_system() # Initialize real-time training
def _initialize_ml_models(self):
"""Initialize ML models for enhanced trading"""
try:
@ -1313,7 +1312,6 @@ class TradingOrchestrator:
except Exception as e:
logger.error(f"❌ Error clearing orchestrator session data: {e}")
def sync_model_states_with_dashboard(self):
"""Sync model states with current dashboard values"""
# Update based on the dashboard stats provided
@ -2096,7 +2094,6 @@ class TradingOrchestrator:
f"Decision callback registered: {callback.__name__ if hasattr(callback, '__name__') else 'unnamed'}"
)
return True
async def make_trading_decision(self, symbol: str) -> Optional[TradingDecision]:
"""
Make a trading decision for a symbol by combining all registered model outputs
@ -3564,7 +3561,6 @@ class TradingOrchestrator:
except Exception as e:
logger.error(f"Error in CNN long-term training: {e}")
async def _evaluate_and_train_on_record(self, record: Dict, current_price: float):
"""Evaluate prediction outcome and train model"""
try:
@ -4487,7 +4483,7 @@ class TradingOrchestrator:
async def _train_rl_model(
self, model, model_name: str, model_input, prediction: Dict, reward: float
) -> bool:
"""Train RL model (DQN) with experience replay"""
memory_size = 0 # Ensure memory_size is always defined
try:
# Convert prediction action to action index
action_names = ["SELL", "HOLD", "BUY"]
@ -7147,7 +7143,6 @@ class TradingOrchestrator:
except Exception as e:
logger.error(f"Error stopping enhanced training: {e}")
return False
def get_enhanced_training_stats(self) -> Dict[str, Any]:
"""Get enhanced training system statistics with orchestrator integration"""
try:
@ -8522,7 +8517,6 @@ class TradingOrchestrator:
status[data_type][symbol] = len(queue)
return status
def get_detailed_queue_status(self) -> Dict[str, Any]:
"""Get detailed status of all data queues with timestamps and data info"""
detailed_status = {}
@ -9078,7 +9072,6 @@ class TradingOrchestrator:
except Exception as e:
logger.error(f"Error populating initial queue data: {e}")
def _try_fallback_data_strategy(
self, symbol: str, missing_data: List[Tuple[str, int, int]]
) -> bool:
"""