Skip to content

Commit

Permalink
Update EnhancedSequenceAnalyzer to use consistent 768 dimensions from…
Browse files Browse the repository at this point in the history
… ESM2
  • Loading branch information
devin-ai-integration[bot] committed Nov 14, 2024
1 parent 8f1749e commit 9fdf490
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions models/analysis/enhanced_sequence_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,34 @@ class EnhancedSequenceAnalyzer(nn.Module):
def __init__(self, config: Dict):
super().__init__()
self.config = config
self.hidden_size = 320 # ESM2's actual output dimension
self.hidden_size = 768 # ESM2's actual output dimension

# Initialize protein language model
self.tokenizer = AutoTokenizer.from_pretrained('facebook/esm2_t6_8M_UR50D')
self.protein_model = AutoModel.from_pretrained('facebook/esm2_t6_8M_UR50D')

# Feature extraction layers - maintain 320 dimensions
# Feature extraction layers - maintain ESM2 dimensions
self.feature_extractor = nn.Sequential(
nn.Linear(320, 320),
nn.Linear(768, 768),
nn.ReLU(),
nn.Dropout(0.1),
nn.Linear(320, 320),
nn.Linear(768, 768),
nn.ReLU(),
nn.Dropout(0.1)
)

# Pattern recognition module - maintain 320 dimensions
# Pattern recognition module - maintain ESM2 dimensions
self.pattern_recognition = nn.Sequential(
nn.Linear(320, 320),
nn.Linear(768, 768),
nn.ReLU(),
nn.Linear(320, 320)
nn.Linear(768, 768)
)

# Conservation analysis module
self.conservation_analyzer = ConservationAnalyzer()

# Motif identification module - updated input size
self.motif_identifier = MotifIdentifier(320)
self.motif_identifier = MotifIdentifier(768)

def forward(self, sequences: List[str]) -> Dict[str, torch.Tensor]:
# Tokenize sequences
Expand Down

0 comments on commit 9fdf490

Please sign in to comment.