espnet2.train.gan_trainer.GANTrainerOptions
espnet2.train.gan_trainer.GANTrainerOptions
class espnet2.train.gan_trainer.GANTrainerOptions(ngpu: int, resume: bool, use_amp: bool, train_dtype: str, grad_noise: bool, accum_grad: int, grad_clip: float, grad_clip_type: float, log_interval: int | None, no_forward_run: bool, use_matplotlib: bool, use_tensorboard: bool, use_wandb: bool, adapter: str, use_adapter: bool, save_strategy: str, output_dir: Path | str, max_epoch: int, seed: int, sharded_ddp: bool, patience: int | None, keep_nbest_models: int | List[int], nbest_averaging_interval: int, early_stopping_criterion: Sequence[str], best_model_criterion: Sequence[Sequence[str]], val_scheduler_criterion: Sequence[str], unused_parameters: bool, wandb_model_log_interval: int, create_graph_in_tensorboard: bool, generator_first: bool, skip_discriminator_prob: float)
Bases: TrainerOptions
Trainer option dataclass for GANTrainer.
This class encapsulates the options that are specific to the GAN training process, inheriting from TrainerOptions. The options defined here include parameters that control the behavior of the generator and discriminator during training.
generator_first
Indicates whether to update the generator first during training.
- Type: bool
skip_discriminator_prob
The probability of skipping the discriminator update step. If this value is greater than 0, the discriminator will be updated with this probability.
- Type: float
Examples
To create an instance of GANTrainerOptions with specific settings:
python options = GANTrainerOptions(generator_first=True, skip_discriminator_prob=0.1)
This instance indicates that the generator should be updated first, and the discriminator update will be skipped with a probability of 0.1.
generator_first
skip_discriminator_prob