Skip to content

Commit a21e77d

Browse files
author
Taras Sereda
authored
positional encoding bugfix
1 parent e513a76 commit a21e77d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deepvoice3_pytorch/modules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def position_encoding_init(n_position, d_pos_vec, position_rate=1.0,
1313

1414
# keep dim 0 for padding token position encoding zero vector
1515
position_enc = np.array([
16-
[position_rate * pos / np.power(10000, 2 * (i // 2) / d_pos_vec) for i in range(d_pos_vec)]
16+
[position_rate * pos / np.power(10000, i / d_pos_vec) for i in range(d_pos_vec)]
1717
if pos != 0 else np.zeros(d_pos_vec) for pos in range(n_position)])
1818

1919
position_enc = torch.from_numpy(position_enc).float()

0 commit comments

Comments
 (0)