cleanup, cob ladder still broken

This commit is contained in:
Dobromir Popov
2025-07-07 01:07:48 +03:00
parent 97d9bc97ee
commit 9101448e78
75 changed files with 546 additions and 12123 deletions

View File

@ -5426,9 +5426,24 @@ class CleanTradingDashboard:
confidence_target_tensor = torch.FloatTensor([confidence_target]).to(device)
network.train()
action_logits, predicted_confidence = network(features_tensor)
network_output = network(features_tensor)
# Handle different return formats from network
if isinstance(network_output, tuple) and len(network_output) == 2:
action_logits, predicted_confidence = network_output
elif hasattr(network_output, 'dim'):
# Single tensor output - assume it's action logits
action_logits = network_output
predicted_confidence = torch.tensor(0.5, device=device) # Default confidence
else:
logger.debug(f"Unexpected network output format: {type(network_output)}")
continue
# Ensure predicted_confidence is a tensor with proper dimensions
if not hasattr(predicted_confidence, 'dim'):
# If it's not a tensor, convert it
predicted_confidence = torch.tensor(float(predicted_confidence), device=device)
# Ensure predicted_confidence has a batch dimension if it doesn't already
if predicted_confidence.dim() == 0:
predicted_confidence = predicted_confidence.unsqueeze(0)
@ -6048,4 +6063,7 @@ def create_clean_dashboard(data_provider: Optional[DataProvider] = None, orchest
data_provider=data_provider,
orchestrator=orchestrator,
trading_executor=trading_executor
)
)
# test edit