Merge branch 'dev-tacotron2'

pull/10/head
Eren Golge 2019-05-29 00:39:20 +02:00
commit f29d1840f9
2 changed files with 3 additions and 4 deletions

View File

@ -207,9 +207,9 @@ class Attention(nn.Module):
_, n = prev_alpha.max(1) _, n = prev_alpha.max(1)
val, n2 = alpha.max(1) val, n2 = alpha.max(1)
for b in range(alignment.shape[0]): for b in range(alignment.shape[0]):
alpha[b, n + 2:] = 0 alpha[b, n[b] + 2:] = 0
alpha[b, :(n - 1)] = 0 # ignore all previous states to prevent repetition. alpha[b, :(n[b] - 1)] = 0 # ignore all previous states to prevent repetition.
alpha[b, (n - 2)] = 0.01 * val # smoothing factor for the prev step alpha[b, (n[b] - 2)] = 0.01 * val[b] # smoothing factor for the prev step
# compute attention weights # compute attention weights
self.alpha = alpha / alpha.sum(dim=1).unsqueeze(1) self.alpha = alpha / alpha.sum(dim=1).unsqueeze(1)
# compute context # compute context

View File

@ -8,6 +8,5 @@ matplotlib==2.0.2
Pillow Pillow
flask flask
scipy==0.19.0 scipy==0.19.0
lws
tqdm tqdm
git+git://github.com/bootphon/phonemizer@master git+git://github.com/bootphon/phonemizer@master