r""" Decoding layers of the RNNModel
| 56 | |
| 57 | |
| 58 | class Decoder(nn.Module): |
| 59 | r""" |
| 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)) |
| 71 | |
| 72 | |
| 73 | class RNNModel(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected