espnet.nets.pytorch_backend.lm.default.RNNLM
Less than 1 minute
espnet.nets.pytorch_backend.lm.default.RNNLM
class espnet.nets.pytorch_backend.lm.default.RNNLM(n_vocab, n_layers, n_units, n_embed=None, typ='lstm', dropout_rate=0.5, emb_dropout_rate=0.0, tie_weights=False)
Bases: Module
A pytorch RNNLM.
Initialize class.
- Parameters:
- n_vocab (int) – The size of the vocabulary
- n_layers (int) – The number of layers to create
- n_units (int) – The number of units per layer
- typ (str) – The RNN type
forward(state, x)
Forward neural networks.
zero_state(batchsize)
Initialize state.