Merge branch 'dev' of https://github.com/coqui-ai/TTS into dev

This commit is contained in:
Eren Gölge 2022-01-01 15:38:46 +00:00
commit 38f5a11125
3 changed files with 12 additions and 5 deletions

View File

@ -37,8 +37,8 @@ In the worse case provide steps to reproduce the behaviour.
You can either run `TTS/bin/collect_env_info.py`
```bash
wget https://raw.githubusercontent.com/coqui-ai/TTS/main/TTS/bin/collect_env_details.py
python collect_env_details.py
wget https://raw.githubusercontent.com/coqui-ai/TTS/main/TTS/bin/collect_env_info.py
python collect_env_info.py
```
or fill in the fields below manually.

View File

@ -113,8 +113,10 @@ class BaseGANVocoderConfig(BaseVocoderConfig):
Parameters for the generator learning rate scheduler. Defaults to `{"gamma": 0.999, "last_epoch": -1}`.
lr_scheduler_disc (torch.optim.Scheduler):
Learning rate scheduler for the discriminator. Defaults to `ExponentialLR`.
lr_scheduler_dict_params (dict):
lr_scheduler_disc_params (dict):
Parameters for the discriminator learning rate scheduler. Defaults to `{"gamma": 0.999, "last_epoch": -1}`.
scheduler_after_epoch (bool):
Whether to update the learning rate schedulers after each epoch. Defaults to True.
use_pqmf (bool):
enable / disable PQMF for subband approximation at training. Defaults to False.
steps_to_start_discriminator (int):
@ -173,6 +175,7 @@ class BaseGANVocoderConfig(BaseVocoderConfig):
lr_scheduler_gen_params: dict = field(default_factory=lambda: {"gamma": 0.999, "last_epoch": -1})
lr_scheduler_disc: str = "ExponentialLR" # one of the schedulers from https:#pytorch.org/docs/stable/optim.html
lr_scheduler_disc_params: dict = field(default_factory=lambda: {"gamma": 0.999, "last_epoch": -1})
scheduler_after_epoch: bool = True
use_pqmf: bool = False # enable/disable using pqmf for multi-band training. (Multi-band MelGAN)
steps_to_start_discriminator = 0 # start training the discriminator after this number of steps.

View File

@ -202,7 +202,9 @@ class GAN(BaseVocoder):
) -> Tuple[Dict, np.ndarray]:
"""Call `_log()` for training."""
ap = assets["audio_processor"]
self._log("train", ap, batch, outputs)
figures, audios = self._log("eval", ap, batch, outputs)
logger.eval_figures(steps, figures)
logger.eval_audios(steps, audios, ap.sample_rate)
@torch.no_grad()
def eval_step(self, batch: Dict, criterion: nn.Module, optimizer_idx: int) -> Tuple[Dict, Dict]:
@ -214,7 +216,9 @@ class GAN(BaseVocoder):
) -> Tuple[Dict, np.ndarray]:
"""Call `_log()` for evaluation."""
ap = assets["audio_processor"]
self._log("eval", ap, batch, outputs)
figures, audios = self._log("eval", ap, batch, outputs)
logger.eval_figures(steps, figures)
logger.eval_audios(steps, audios, ap.sample_rate)
def load_checkpoint(
self,