(self, hidden, encoder_output)
| 757 | return torch.sum(hidden * encoder_output, dim=2) |
| 758 | |
| 759 | def general_score(self, hidden, encoder_output): |
| 760 | energy = self.attn(encoder_output) |
| 761 | return torch.sum(hidden * energy, dim=2) |
| 762 | |
| 763 | def concat_score(self, hidden, encoder_output): |
| 764 | energy = self.attn(torch.cat((hidden.expand(encoder_output.size(0), -1, -1), encoder_output), 2)).tanh() |