(self, ntoken, nhid, dropout)
| 60 | Decoding layers of the RNNModel |
| 61 | """ |
| 62 | def __init__(self, ntoken, nhid, dropout): |
| 63 | super(Decoder, self).__init__() |
| 64 | self.drop = nn.Dropout(dropout) |
| 65 | self.decoder = nn.Linear(nhid, ntoken) |
| 66 | nn.init.zeros_(self.decoder.bias) |
| 67 | nn.init.uniform_(self.decoder.weight, -0.1, 0.1) |
| 68 | |
| 69 | def forward(self, output): |
| 70 | return self.decoder(self.drop(output)) |