diff --git a/data/ui_state.json b/data/ui_state.json index 26a1419..b66f752 100644 --- a/data/ui_state.json +++ b/data/ui_state.json @@ -14,7 +14,7 @@ }, "decision_fusion": { "inference_enabled": false, - "training_enabled": false + "training_enabled": true }, "transformer": { "inference_enabled": false, @@ -25,5 +25,5 @@ "training_enabled": true } }, - "timestamp": "2025-07-29T19:17:32.971226" + "timestamp": "2025-07-29T23:22:58.380697" } \ No newline at end of file diff --git a/web/models_training_panel.py b/web/models_training_panel.py index 3de204b..352d8a2 100644 --- a/web/models_training_panel.py +++ b/web/models_training_panel.py @@ -73,9 +73,25 @@ class ModelsTrainingPanel: for model_name, model_info in registered_models.items(): data['models'][model_name] = self._extract_model_data(model_name, model_info) - # Add decision fusion model if it exists - if hasattr(self.orchestrator, 'decision_fusion') and self.orchestrator.decision_fusion: + # Add decision fusion model if it exists (check multiple sources) + decision_fusion_added = False + + # Check if it's in the model registry + if hasattr(self.orchestrator, 'model_registry') and self.orchestrator.model_registry: + registered_models = self.orchestrator.model_registry.get_all_models() + if 'decision_fusion' in registered_models: + data['models']['decision_fusion'] = self._extract_decision_fusion_data() + decision_fusion_added = True + + # If not in registry, check if decision fusion network exists + if not decision_fusion_added and hasattr(self.orchestrator, 'decision_fusion_network') and self.orchestrator.decision_fusion_network: data['models']['decision_fusion'] = self._extract_decision_fusion_data() + decision_fusion_added = True + + # If still not added, check if decision fusion is enabled + if not decision_fusion_added and hasattr(self.orchestrator, 'decision_fusion_enabled') and self.orchestrator.decision_fusion_enabled: + data['models']['decision_fusion'] = self._extract_decision_fusion_data() + decision_fusion_added = True # Add COB RL model if it exists but wasn't captured in registry if 'cob_rl_model' not in data['models'] and hasattr(self.orchestrator, 'cob_rl_model'): @@ -251,13 +267,24 @@ class ModelsTrainingPanel: 'signal_stats': {} } - # Check if decision fusion is actually enabled + # Check if decision fusion is actually enabled and working if hasattr(self.orchestrator, 'decision_fusion_enabled'): decision_data['status'] = 'active' if self.orchestrator.decision_fusion_enabled else 'registered' - # Also check from logs - decision fusion may be in programmatic mode - # Based on the logs, if we see "using programmatic mode", it means it's working - decision_data['status'] = 'active' # Assume active since we see it in logs + # Check if decision fusion network exists + if hasattr(self.orchestrator, 'decision_fusion_network') and self.orchestrator.decision_fusion_network: + decision_data['status'] = 'active' + # Get network parameters + if hasattr(self.orchestrator.decision_fusion_network, 'parameters'): + decision_data['parameters'] = sum(p.numel() for p in self.orchestrator.decision_fusion_network.parameters()) + + # Check decision fusion mode + if hasattr(self.orchestrator, 'decision_fusion_mode'): + decision_data['mode'] = self.orchestrator.decision_fusion_mode + if self.orchestrator.decision_fusion_mode == 'neural': + decision_data['status'] = 'active' + elif self.orchestrator.decision_fusion_mode == 'programmatic': + decision_data['status'] = 'active' # Still active, just using programmatic mode # Get decision fusion statistics if hasattr(self.orchestrator, 'get_decision_fusion_stats'): @@ -476,6 +503,8 @@ class ModelsTrainingPanel: html.Strong(f"{model_name.upper()}", className=status_class), html.Span(f" - {status_text}", className=f"{status_class} small ms-1"), html.Span(f" ({size_str})", className="text-muted small ms-2"), + # Show mode for decision fusion + *([html.Span(f" [{model_data.get('mode', 'unknown').upper()}]", className="text-info small ms-1")] if model_name == 'decision_fusion' and model_data.get('mode') else []), html.Span( " [CKPT]" if model_data.get('checkpoint_loaded') else " [FAILED]" if model_data.get('checkpoint_failed')