espnet.lm.pytorch_backend.lm.LMEvaluator
Less than 1 minute
espnet.lm.pytorch_backend.lm.LMEvaluator
class espnet.lm.pytorch_backend.lm.LMEvaluator(val_iter, eval_model, reporter, device)
Bases: BaseEvaluator
A custom evaluator for a pytorch LM.
Initialize class.
:param chainer.dataset.Iterator val_iter : The validation iterator :param LMInterface eval_model : The model to evaluate :param chainer.Reporter reporter : The observations reporter :param int device : The device id to use
evaluate()
Evaluate the model.