Skip to content

Commit

Permalink
ensure pooler consistency
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiyuan Chen <[email protected]>
  • Loading branch information
ZhiyuanChen committed Apr 23, 2024
1 parent 0b0248f commit 262e5c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions multimolecule/models/rnabert/modeling_rnabert.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,8 @@ def __init__(self, config: RnaBertConfig):
self.activation = nn.Tanh()

def forward(self, hidden_states: Tensor) -> Tensor:
# We "pool" the model by simply taking the hidden state corresponding
# to the first token.
first_token_tensor = hidden_states[:, 0]
pooled_output = self.dense(first_token_tensor)
pooled_output = self.activation(pooled_output)
Expand Down
2 changes: 2 additions & 0 deletions multimolecule/models/rnamsm/modeling_rnamsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,8 @@ def __init__(self, config: RnaMsmConfig):
self.activation = nn.Tanh()

def forward(self, hidden_states: Tensor) -> Tensor:
# We "pool" the model by simply taking the hidden state corresponding
# to the first token.
first_token_tensor = hidden_states[:, 0]
pooled_output = self.dense(first_token_tensor)
pooled_output = self.activation(pooled_output)
Expand Down

0 comments on commit 262e5c5

Please sign in to comment.