espnet3.systems.esp2_codec.src.gan_trainer.GANLightningTrainer
espnet3.systems.esp2_codec.src.gan_trainer.GANLightningTrainer
class espnet3.systems.esp2_codec.src.gan_trainer.GANLightningTrainer(model=None, exp_dir: str | None = None, config=None, best_model_criterion=None)
Bases: ESPnet3LightningTrainer
ESPnet3 trainer wrapper that strips GAN-only trainer config.
Initialize GANLightningTrainer, stripping GAN-specific config keys.
Removes the gan sub-config from config before delegating to the parent ESPnet3LightningTrainer, so GAN-only keys (e.g. generator/ discriminator turn order, discriminator skip probability) do not interfere with the base Lightning trainer, which splats the rest of the block into lightning.Trainer(**config).
- Parameters:
- model – The Lightning module to train, normally a
GANLightningModule. - exp_dir – Experiment directory for checkpoints and logs.
- config – The recipe’s
trainerblock. May contain agansub-block, which is removed here rather than mutated in place – config itself is left untouched. - best_model_criterion – Checkpoint selection rules, each of the form
[monitor_key, num_to_keep, "min" | "max"].
- model – The Lightning module to train, normally a
Examples
Usually reached through build_gan_trainer() rather than constructed directly:
```python trainer = GANLightningTrainer(
model=GANLightningModule(model, config), exp_dir=config.exp_dir, config=config.trainer, # may include gan: best_model_criterion=config.best_model_criterion,
