MCPcopy Create free account
hub / github.com/649453932/Chinese-Text-Classification-Pytorch / forward

Method forward

models/FastText.py:57–69  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

55 self.fc2 = nn.Linear(config.hidden_size, config.num_classes)
56
57 def forward(self, x):
58
59 out_word = self.embedding(x[0])
60 out_bigram = self.embedding_ngram2(x[2])
61 out_trigram = self.embedding_ngram3(x[3])
62 out = torch.cat((out_word, out_bigram, out_trigram), -1)
63
64 out = out.mean(dim=1)
65 out = self.dropout(out)
66 out = self.fc1(out)
67 out = F.relu(out)
68 out = self.fc2(out)
69 return out

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected