(self, **kwargs)
| 122 | self.classifier = nn.Linear(self.fea_dim,2) |
| 123 | |
| 124 | def forward(self, **kwargs): |
| 125 | title_w2v = kwargs['title_w2v'] |
| 126 | text = title_w2v.unsqueeze(1) |
| 127 | text = [F.relu(conv(text)).squeeze(3) for conv in self.textcnn] |
| 128 | text = [F.max_pool1d(i.squeeze(2), i.shape[-1]).squeeze(2) for i in text] |
| 129 | fea_text = torch.cat(text, 1) |
| 130 | fea_text = self.linear(fea_text) |
| 131 | |
| 132 | output = self.classifier(fea_text) |
| 133 | |
| 134 | return output |
| 135 | |
| 136 | class bComments(torch.nn.Module): |
| 137 | def __init__(self,bert_model,fea_dim): |
nothing calls this directly
no outgoing calls
no test coverage detected