(self, input_size, hidden_size, output_size)
| 39 | class BidirectionalLSTM(nn.Module): |
| 40 | |
| 41 | def __init__(self, input_size, hidden_size, output_size): |
| 42 | super(BidirectionalLSTM, self).__init__() |
| 43 | self.rnn = nn.LSTM(input_size, hidden_size, bidirectional=True, batch_first=True) |
| 44 | self.linear = nn.Linear(hidden_size * 2, output_size) |
| 45 | # self.h0 = torch.randn(2, 1, hidden_size).cuda() |
| 46 | # self.c0 = torch.randn(2, 1, hidden_size).cuda() |
| 47 | |
| 48 | def forward(self, input): |
| 49 | """ |