We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f59a293 commit 0c325f4Copy full SHA for 0c325f4
training/nsf_HiFigan_task.py
@@ -268,7 +268,9 @@ def Gforward(self, sample):
268
269
def G2forward(self, sample):
270
f0 = sample['f0']
271
- b = int(np.round(f0.shape[0] * self.pc_aug_prob))
+ b = np.random.binomial(n=f0.shape[0], p=self.pc_aug_prob)
272
+ if b == 0:
273
+ return self.Gforward(sample)
274
key = (2 * torch.rand(b, device=f0.device).unsqueeze(-1) - 1) * self.pc_aug_key
275
aug_f0 = torch.cat((f0[: b] * 2 ** (key / 12), f0[b :]), dim=0)
276
wav = self.generator(x=sample['mel'], f0=aug_f0)
0 commit comments