Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Buethe <jbuethe@amazon.de>2023-09-22 12:18:41 +0300
committerJan Buethe <jbuethe@amazon.de>2023-09-22 12:18:41 +0300
commitaad74fdfd6ffe7df1986cfb6f410f203c16ab094 (patch)
tree903550d4d4f84cfb63535e2e1502aa4993b26922
parent0a92bc5eaa6467d63efbed0b5ff625db64be5629 (diff)
pulse-related bugfix
-rw-r--r--dnn/torch/osce/models/lavoce.py4
-rw-r--r--dnn/torch/osce/models/lavoce_400.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/dnn/torch/osce/models/lavoce.py b/dnn/torch/osce/models/lavoce.py
index 795246b9..47b6d1e9 100644
--- a/dnn/torch/osce/models/lavoce.py
+++ b/dnn/torch/osce/models/lavoce.py
@@ -133,7 +133,7 @@ class LaVoce(nn.Module):
self.post_af3 = nn.Conv1d(cond_dim, cond_dim, ftrans_k)
- def create_phase_signals(self, periods, pulses=False):
+ def create_phase_signals(self, periods):
batch_size = periods.size(0)
progression = torch.arange(1, self.FRAME_SIZE + 1, dtype=periods.dtype, device=periods.device).view((1, -1))
@@ -144,7 +144,7 @@ class LaVoce(nn.Module):
for sframe in range(periods.size(1)):
f = (2.0 * torch.pi / periods[:, sframe]).unsqueeze(-1)
- if pulses:
+ if self.pulses:
alpha = torch.cos(f)
chunk_sin = torch.sin(f * progression + phase0).view(batch_size, 1, self.FRAME_SIZE)
pulse_a = torch.relu(chunk_sin - alpha) / (1 - alpha)
diff --git a/dnn/torch/osce/models/lavoce_400.py b/dnn/torch/osce/models/lavoce_400.py
index ab7724df..e9a543cf 100644
--- a/dnn/torch/osce/models/lavoce_400.py
+++ b/dnn/torch/osce/models/lavoce_400.py
@@ -118,7 +118,7 @@ class LaVoce400(nn.Module):
self.post_af3 = nn.Conv1d(cond_dim, cond_dim, 2)
- def create_phase_signals(self, periods, pulses=False):
+ def create_phase_signals(self, periods):
batch_size = periods.size(0)
progression = torch.arange(1, self.FRAME_SIZE + 1, dtype=periods.dtype, device=periods.device).view((1, -1))
@@ -129,7 +129,7 @@ class LaVoce400(nn.Module):
for sframe in range(periods.size(1)):
f = (2.0 * torch.pi / periods[:, sframe]).unsqueeze(-1)
- if pulses:
+ if self.pulses:
alpha = torch.cos(f)
chunk_sin = torch.sin(f * progression + phase0).view(batch_size, 1, self.FRAME_SIZE)
pulse_a = torch.relu(chunk_sin - alpha) / (1 - alpha)