debug 反量化 我发现flow里面有反量化的代码
This commit is contained in:
@@ -665,12 +665,13 @@ class SynthesizerTrn(nn.Module):
|
||||
attn = monotonic_align.maximum_path(neg_cent, attn_mask.squeeze(1)).unsqueeze(1).detach()
|
||||
|
||||
w = attn.sum(2)
|
||||
# 反量化
|
||||
w -= torch.rand_like(w)
|
||||
|
||||
l_length_sdp = self.sdp(x, x_mask, w, g=g)
|
||||
l_length_sdp = l_length_sdp / torch.sum(x_mask)
|
||||
|
||||
# 反量化
|
||||
w -= torch.rand_like(w)
|
||||
|
||||
logw_ = torch.log(w + 1e-6) * x_mask
|
||||
logw = self.dp(x, x_mask, g=g)
|
||||
l_length_dp = torch.sum((logw - logw_) ** 2, [1, 2]) / torch.sum(x_mask) # for averaging
|
||||
|
||||
Reference in New Issue
Block a user