espnet3.systems.esp2_codec.system.ESP2CodecSystem
espnet3.systems.esp2_codec.system.ESP2CodecSystem
class espnet3.systems.esp2_codec.system.ESP2CodecSystem(training_config: DictConfig | None = None, inference_config: DictConfig | None = None, metrics_config: DictConfig | None = None, publication_config: DictConfig | None = None, demo_config: DictConfig | None = None)
Bases: BaseSystem
Neural codec system on ESPnet2’s GANCodecTask.
Inherits BaseSystem.stages; collect_stats and train are overridden to build the GAN trainer for AbsGANESPnetModel models.
######### Examples
>>> [s.name for s in ESP2CodecSystem.stages[:3]]
['create_dataset', 'collect_stats', 'train']Initialize the system with optional stage configs.
- Parameters:
- training_config – Training configuration for data preparation, statistics collection, and model training.
- inference_config – Inference configuration used by the
inferstage. - metrics_config – Measurement configuration used by the
measurestage. - publication_config – Publication configuration for
pack_modelandupload_modelstages. - demo_config – Demo configuration for the
demostage.
collect_stats(*args, **kwargs)
Run the collect_stats stage using the configured trainer.
- Parameters:
- *args – Not accepted. Stage settings belong in the YAML config.
- **kwargs – Not accepted, for the same reason.
- Returns: None. Statistics are written under
training_config.stats_dir. - Raises:TypeError – If any positional or keyword argument is passed.
######### Examples
Invoked by run.py for the collect_stats stage: python system = ESP2CodecSystem(training_config=cfg) system.collect_stats()
train(*args, **kwargs)
Run the training stage using the configured trainer.
For GAN codec models a GANLightningTrainer is used automatically (see espnet3.systems.esp2_codec.src.gan_trainer.build_gan_trainer); otherwise ESPnet3LightningTrainer is used. When training_config.task is set, the resolved ESPnet config is saved into exp_dir before fitting.
- Parameters:
- *args – Not accepted. Stage settings belong in the YAML config.
- **kwargs – Not accepted, for the same reason.
- Returns: None. Checkpoints and logs are written under
training_config.exp_dir. - Raises:TypeError – If any positional or keyword argument is passed.
######### Examples
Invoked by run.py for the train stage: python system = ESP2CodecSystem(training_config=cfg) system.train()
Extra keyword arguments for trainer.fit come from the config’s fit block, not from this call:
```yaml fit:
ckpt_path: exp/train_encodec_libritts/last.ckpt
```