(self, x, y)
| 137 | self.cross_entropy_loss = torch.nn.CrossEntropyLoss() |
| 138 | |
| 139 | def forward(self, x, y): |
| 140 | hidden_dim = x |
| 141 | hidden_dim = self.linear(hidden_dim) |
| 142 | output, _, _ = self.linear2(hidden_dim) |
| 143 | output, _, _ = self.linear3(output) |
| 144 | hidden_dim = hidden_dim + output |
| 145 | sentence_embed = hidden_dim.mean(1) |
| 146 | return self.cross_entropy_loss(sentence_embed, y) |
| 147 | |
| 148 | |
| 149 | class UnusedParametersModel(SimpleModel): |