risk managment

This commit is contained in:
Dobromir Popov
2025-07-04 20:52:40 +03:00
parent ed42e7c238
commit e8b9c05148
3 changed files with 40 additions and 8 deletions

View File

@ -303,13 +303,15 @@ class EnhancedCNNModel(nn.Module):
batch_size, seq_len, features = x.shape
# Reshape for processing: [batch, seq, features] -> [batch*seq, features]
x_reshaped = x.view(-1, features)
x_reshaped = x.reshape(-1, features)
x_reshaped = self._memory_barrier(x_reshaped)
# Input embedding
embedded = self.input_embedding(x_reshaped) # [batch*seq, base_channels]
embedded = self._memory_barrier(embedded)
# Reshape back for conv1d: [batch*seq, channels] -> [batch, channels, seq]
embedded = embedded.view(batch_size, seq_len, -1).transpose(1, 2)
embedded = embedded.reshape(batch_size, seq_len, -1).transpose(1, 2).contiguous()
# Multi-scale feature extraction
path1 = self.conv_path1(embedded)