espnet.lm.chainer_backend.lm.ClassifierWithState
Less than 1 minute
espnet.lm.chainer_backend.lm.ClassifierWithState
class espnet.lm.chainer_backend.lm.ClassifierWithState(predictor, lossfun=<function softmax_cross_entropy>, label_key=-1)
Bases: Chain
A wrapper for a chainer RNNLM.
:param link.Chain predictor : The RNNLM :param function lossfun: The loss function to use :param int/str label_key:
Initialize class.
final(state)
Predict final log probabilities for given state using the predictor.
:param state : the state :return log probability vector :rtype cupy/numpy array
predict(state, x)
Predict log probabilities for given state and input x using the predictor.
:param state : the state :param x : the input :return a tuple (state, log prob vector) :rtype cupy/numpy array