integrating new CNN model
This commit is contained in:
@ -371,6 +371,10 @@ class EnhancedCNN(nn.Module):
|
||||
nn.Linear(128, 4) # Low risk, medium risk, high risk, extreme risk
|
||||
)
|
||||
|
||||
def _memory_barrier(self, tensor: torch.Tensor) -> torch.Tensor:
|
||||
"""Create a memory barrier to prevent in-place operation issues"""
|
||||
return tensor.detach().clone().requires_grad_(tensor.requires_grad)
|
||||
|
||||
def _check_rebuild_network(self, features):
|
||||
"""Check if network needs to be rebuilt for different feature dimensions"""
|
||||
# Prevent rebuilding with zero or invalid dimensions
|
||||
|
Reference in New Issue
Block a user