mirror of https://github.com/coqui-ai/TTS.git
Fix Speaker Consistency Loss (SCL) (#2364)
This commit is contained in:
parent
a365a7e888
commit
16b9862252
|
@ -161,16 +161,14 @@ class ResNetSpeakerEncoder(BaseEncoder):
|
||||||
Shapes:
|
Shapes:
|
||||||
- x: :math:`(N, 1, T_{in})` or :math:`(N, D_{spec}, T_{in})`
|
- x: :math:`(N, 1, T_{in})` or :math:`(N, D_{spec}, T_{in})`
|
||||||
"""
|
"""
|
||||||
with torch.no_grad():
|
x.squeeze_(1)
|
||||||
with torch.cuda.amp.autocast(enabled=False):
|
# if you torch spec compute it otherwise use the mel spec computed by the AP
|
||||||
x.squeeze_(1)
|
if self.use_torch_spec:
|
||||||
# if you torch spec compute it otherwise use the mel spec computed by the AP
|
x = self.torch_spec(x)
|
||||||
if self.use_torch_spec:
|
|
||||||
x = self.torch_spec(x)
|
|
||||||
|
|
||||||
if self.log_input:
|
if self.log_input:
|
||||||
x = (x + 1e-6).log()
|
x = (x + 1e-6).log()
|
||||||
x = self.instancenorm(x).unsqueeze(1)
|
x = self.instancenorm(x).unsqueeze(1)
|
||||||
|
|
||||||
x = self.conv1(x)
|
x = self.conv1(x)
|
||||||
x = self.relu(x)
|
x = self.relu(x)
|
||||||
|
|
Loading…
Reference in New Issue