espnet.lm.pytorch_backend.lm.BPTTUpdater
Less than 1 minute
espnet.lm.pytorch_backend.lm.BPTTUpdater
class espnet.lm.pytorch_backend.lm.BPTTUpdater(train_iter, model, optimizer, schedulers, device, gradclip=None, use_apex=False, accum_grad=1)
Bases: StandardUpdater
An updater for a pytorch LM.
Initialize class.
- Parameters:
- train_iter (chainer.dataset.Iterator) – The train iterator
- model (LMInterface) – The model to update
- optimizer (torch.optim.Optimizer) – The optimizer for training
- schedulers (espnet.scheduler.scheduler.SchedulerInterface) – The schedulers of optimizer
- device (int) – The device id
- gradclip (float) – The gradient clipping value to use
- use_apex (bool) – The flag to use Apex in backprop.
- accum_grad (int) – The number of gradient accumulation.
update_core()
Update the model.