(self, xs)
| 120 | return xs |
| 121 | |
| 122 | def out2dur(self, xs): |
| 123 | if hparams['dur_loss'] in ['mse']: |
| 124 | # NOTE: calculate in log domain |
| 125 | xs = xs.squeeze(-1) # (B, Tmax) |
| 126 | dur = torch.clamp(torch.round(xs.exp() - self.offset), min=0).long() # avoid negative value |
| 127 | elif hparams['dur_loss'] == 'mog': |
| 128 | return NotImplementedError |
| 129 | elif hparams['dur_loss'] == 'crf': |
| 130 | dur = torch.LongTensor(self.crf.decode(xs)).cuda() |
| 131 | return dur |
| 132 | |
| 133 | def forward(self, xs, x_masks=None): |
| 134 | """Calculate forward propagation. |