fixed other CNN references
This commit is contained in:
@ -501,7 +501,16 @@ class EnhancedCNNWithOrderBook(nn.Module):
|
||||
# Get probabilities
|
||||
q_values = outputs['q_values']
|
||||
probs = F.softmax(q_values, dim=1)
|
||||
confidence = outputs['confidence'].item()
|
||||
|
||||
# Handle confidence shape properly to avoid scalar conversion errors
|
||||
confidence_tensor = outputs['confidence']
|
||||
if isinstance(confidence_tensor, torch.Tensor):
|
||||
if confidence_tensor.numel() == 1:
|
||||
confidence = confidence_tensor.item()
|
||||
else:
|
||||
confidence = confidence_tensor.flatten()[0].item()
|
||||
else:
|
||||
confidence = float(confidence_tensor)
|
||||
|
||||
# Action selection with confidence thresholding
|
||||
if confidence >= self.confidence_threshold:
|
||||
|
Reference in New Issue
Block a user