scalping dash also works initially
This commit is contained in:
@ -335,13 +335,14 @@ class EnhancedCNN(nn.Module):
|
||||
|
||||
# Process different input shapes
|
||||
if len(x.shape) > 2:
|
||||
# Handle 3D input [batch, timeframes, features]
|
||||
# Handle 4D input [batch, timeframes, window, features] or 3D input [batch, timeframes, features]
|
||||
if len(x.shape) == 4:
|
||||
# Flatten window and features: [batch, timeframes, window*features]
|
||||
x = x.view(batch_size, x.size(1), -1)
|
||||
|
||||
if self.conv_layers is not None:
|
||||
# Reshape for 1D convolution:
|
||||
# [batch, timeframes, features] -> [batch, timeframes, features*1]
|
||||
if len(x.shape) == 3:
|
||||
x = x.permute(0, 1, 2) # Ensure shape is [batch, timeframes, features]
|
||||
x_reshaped = x.permute(0, 1, 2) # [batch, timeframes, features]
|
||||
# Now x is 3D: [batch, timeframes, features]
|
||||
x_reshaped = x
|
||||
|
||||
# Check if the feature dimension has changed and rebuild if necessary
|
||||
if x_reshaped.size(1) * x_reshaped.size(2) != self.feature_dim:
|
||||
|
Reference in New Issue
Block a user