(self, inputs)
| 47 | init_weights(self) |
| 48 | |
| 49 | def forward(self, inputs): |
| 50 | embeds = self.embeddings(inputs) |
| 51 | # 计算隐含层:对上下文词向量求平均 |
| 52 | hidden = embeds.mean(dim=1) |
| 53 | output = self.output(hidden) |
| 54 | log_probs = F.log_softmax(output, dim=1) |
| 55 | return log_probs |
| 56 | |
| 57 | embedding_dim = 64 |
| 58 | context_size = 2 |
nothing calls this directly
no outgoing calls
no test coverage detected