paddlespeech.t2s.models.melgan.multi_band_melgan_updater module
- class paddlespeech.t2s.models.melgan.multi_band_melgan_updater.MBMelGANEvaluator(models: Dict[str, Layer], criterions: Dict[str, Layer], dataloader: DataLoader, lambda_aux: float = 1.0, lambda_adv: float = 1.0, output_dir: Optional[Path] = None)[source]
Bases:
StandardEvaluator
- Attributes:
- name
Methods
__call__
([trainer])Main action of the extention.
finalize
(trainer)Action that is executed when training is done.
initialize
(trainer)Action that is executed once to get the corect trainer state.
on_error
(trainer, exc, tb)Handles the error raised during training before finalization.
evaluate
evaluate_core
- class paddlespeech.t2s.models.melgan.multi_band_melgan_updater.MBMelGANUpdater(models: Dict[str, Layer], optimizers: Dict[str, Optimizer], criterions: Dict[str, Layer], schedulers: Dict[str, LRScheduler], dataloader: DataLoader, generator_train_start_steps: int = 0, discriminator_train_start_steps: int = 100000, lambda_aux: float = 1.0, lambda_adv: float = 1.0, output_dir: Optional[Path] = None)[source]
Bases:
StandardUpdater
- Attributes:
updates_per_epoch
Number of updater per epoch, determined by the length of the dataloader.
Methods
new_epoch
()Start a new epoch.
read_batch
()Read a batch from the data loader, auto renew when data is exhausted.
set_state_dict
(state_dict)Set state dict for a Updater.
state_dict
()State dict of a Updater, model, optimizer and updater state are included.
update_core
(batch)A simple case for a training step.
load
save
update
- update_core(batch)[source]
A simple case for a training step. Basic assumptions are: Single model; Single optimizer; A batch from the dataloader is just the input of the model; The model return a single loss, or a dict containing serval losses. Parameters updates at every batch, no gradient accumulation.