MCPcopy Create free account
hub / github.com/ICTMCG/FakeSV / forward

Method forward

code/models/Baselines.py:145–158  ·  view source on GitHub ↗
(self,  **kwargs)

Source from the content-addressed store, hash-verified

143 self.classifier = nn.Linear(fea_dim,2)
144
145 def forward(self, **kwargs):
146 comments_inputid = kwargs['comments_inputid']
147 comments_mask=kwargs['comments_mask']
148 comments_feature=[]
149 for i in range(comments_inputid.shape[0]):
150 bert_fea=self.bert(comments_inputid[i], attention_mask=comments_mask[i])[1]
151 comments_feature.append(bert_fea)
152 comments_feature=torch.stack(comments_feature)
153 fea_comments=self.linear_comment(comments_feature)
154 print (fea_comments.shape)
155 fea_comments = self.attention(fea_comments)
156 fea_comments = torch.mean(fea_comments, -2)
157 output = self.classifier(fea_comments)
158 return output
159
160

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected