i think we fixed mexc interface at the end!!!
This commit is contained in:
@ -1549,38 +1549,28 @@ class TradingOrchestrator:
|
||||
self.model_states['extrema_trainer']['current_loss'] = estimated_loss
|
||||
self.model_states['extrema_trainer']['best_loss'] = estimated_loss
|
||||
|
||||
# Ensure initial_loss is set for new models
|
||||
# NO LONGER SETTING SYNTHETIC INITIAL LOSS VALUES
|
||||
# Keep all None values as None if no real data is available
|
||||
# This prevents the "fake progress" issue where Current Loss = Initial Loss
|
||||
|
||||
# Only set initial_loss from actual training history if available
|
||||
for model_key, model_state in self.model_states.items():
|
||||
if model_state['initial_loss'] is None:
|
||||
# Set reasonable initial loss values for new models
|
||||
initial_losses = {
|
||||
'dqn': 0.285,
|
||||
'cnn': 0.412,
|
||||
'cob_rl': 0.356,
|
||||
'decision': 0.298,
|
||||
'extrema_trainer': 0.356
|
||||
}
|
||||
model_state['initial_loss'] = initial_losses.get(model_key, 0.3)
|
||||
|
||||
# If current_loss is None, set it to initial_loss
|
||||
if model_state['current_loss'] is None:
|
||||
model_state['current_loss'] = model_state['initial_loss']
|
||||
|
||||
# If best_loss is None, set it to current_loss
|
||||
if model_state['best_loss'] is None:
|
||||
model_state['best_loss'] = model_state['current_loss']
|
||||
# Leave initial_loss as None if no real training history exists
|
||||
# Leave current_loss as None if model isn't actively training
|
||||
# Leave best_loss as None if no checkpoints exist with real performance data
|
||||
pass # No synthetic data generation
|
||||
|
||||
return self.model_states
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error getting model states: {e}")
|
||||
# Return safe fallback values
|
||||
# Return None values instead of synthetic data
|
||||
return {
|
||||
'dqn': {'initial_loss': 0.285, 'current_loss': 0.285, 'best_loss': 0.285, 'checkpoint_loaded': False},
|
||||
'cnn': {'initial_loss': 0.412, 'current_loss': 0.412, 'best_loss': 0.412, 'checkpoint_loaded': False},
|
||||
'cob_rl': {'initial_loss': 0.356, 'current_loss': 0.356, 'best_loss': 0.356, 'checkpoint_loaded': False},
|
||||
'decision': {'initial_loss': 0.298, 'current_loss': 0.298, 'best_loss': 0.298, 'checkpoint_loaded': False},
|
||||
'extrema_trainer': {'initial_loss': 0.356, 'current_loss': 0.356, 'best_loss': 0.356, 'checkpoint_loaded': False}
|
||||
'dqn': {'initial_loss': None, 'current_loss': None, 'best_loss': None, 'checkpoint_loaded': False},
|
||||
'cnn': {'initial_loss': None, 'current_loss': None, 'best_loss': None, 'checkpoint_loaded': False},
|
||||
'cob_rl': {'initial_loss': None, 'current_loss': None, 'best_loss': None, 'checkpoint_loaded': False},
|
||||
'decision': {'initial_loss': None, 'current_loss': None, 'best_loss': None, 'checkpoint_loaded': False},
|
||||
'extrema_trainer': {'initial_loss': None, 'current_loss': None, 'best_loss': None, 'checkpoint_loaded': False}
|
||||
}
|
||||
|
||||
def update_model_loss(self, model_name: str, current_loss: float, best_loss: float = None):
|
||||
|
Reference in New Issue
Block a user