(self)
| 28 | |
| 29 | class FastSpeech2Task(TtsTask): |
| 30 | def __init__(self): |
| 31 | super(FastSpeech2Task, self).__init__() |
| 32 | self.dataset_cls = FastSpeechDataset |
| 33 | self.mse_loss_fn = torch.nn.MSELoss() |
| 34 | mel_losses = hparams['mel_loss'].split("|") |
| 35 | self.loss_and_lambda = {} |
| 36 | for i, l in enumerate(mel_losses): |
| 37 | if l == '': |
| 38 | continue |
| 39 | if ':' in l: |
| 40 | l, lbd = l.split(":") |
| 41 | lbd = float(lbd) |
| 42 | else: |
| 43 | lbd = 1.0 |
| 44 | self.loss_and_lambda[l] = lbd |
| 45 | print("| Mel losses:", self.loss_and_lambda) |
| 46 | self.sil_ph = self.phone_encoder.sil_phonemes() |
| 47 | |
| 48 | @data_loader |
| 49 | def train_dataloader(self): |
nothing calls this directly
no test coverage detected