remove academic and change to iic/CosyVoice_ttsfrd

This commit is contained in:
lyuxiang.lx
2024-07-07 12:19:34 +08:00
parent 834053940d
commit 71238461f0
7 changed files with 22 additions and 13 deletions

View File

@@ -91,3 +91,13 @@ def th_accuracy(pad_outputs: torch.Tensor, pad_targets: torch.Tensor,
pad_pred.masked_select(mask) == pad_targets.masked_select(mask))
denominator = torch.sum(mask)
return (numerator / denominator).detach()
def get_padding(kernel_size, dilation=1):
return int((kernel_size * dilation - dilation) / 2)
def init_weights(m, mean=0.0, std=0.01):
classname = m.__class__.__name__
if classname.find("Conv") != -1:
m.weight.data.normal_(mean, std)