improved data structure
This commit is contained in:
@@ -2203,7 +2203,17 @@ class TradingOrchestrator:
|
||||
|
||||
# Enhanced architecture for complex decision making
|
||||
self.fc1 = nn.Linear(input_size, hidden_size)
|
||||
self.layer_norm1 = nn.LayerNorm(hidden_size)
|
||||
self.dropout = nn.Dropout(0.1)
|
||||
|
||||
self.fc2 = nn.Linear(hidden_size, hidden_size)
|
||||
self.layer_norm2 = nn.LayerNorm(hidden_size)
|
||||
|
||||
self.fc3 = nn.Linear(hidden_size, hidden_size // 2)
|
||||
self.layer_norm3 = nn.LayerNorm(hidden_size // 2)
|
||||
|
||||
self.fc4 = nn.Linear(hidden_size // 2, 3) # BUY, SELL, HOLD
|
||||
|
||||
def forward(self, x):
|
||||
x = torch.relu(self.layer_norm1(self.fc1(x)))
|
||||
x = self.dropout(x)
|
||||
@@ -2211,7 +2221,9 @@ class TradingOrchestrator:
|
||||
x = self.dropout(x)
|
||||
x = torch.relu(self.layer_norm3(self.fc3(x)))
|
||||
x = self.dropout(x)
|
||||
return torch.softmax(self.fc4(x), dim=1)
|
||||
action_logits = self.fc4(x)
|
||||
action_probs = torch.softmax(action_logits, dim=1)
|
||||
return action_logits, action_probs[:, 0:1] # Return logits and confidence (BUY prob)
|
||||
|
||||
def save(self, filepath: str):
|
||||
"""Save the decision fusion network"""
|
||||
|
||||
Reference in New Issue
Block a user