Skip to content

Commit

Permalink
Update transformer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
yhcc authored Jun 22, 2020
1 parent 7a3859e commit 00a1894
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, d_model, n_head, dropout=0.1, scale=False):
assert d_model%n_head==0

self.n_head = n_head
self.qkv_linear = nn.Linear(d_model, 3*d_model)
self.qkv_linear = nn.Linear(d_model, 3*d_model, bias=False)
self.fc = nn.Linear(d_model, d_model)
self.dropout_layer = nn.Dropout(dropout)

Expand Down Expand Up @@ -235,4 +235,4 @@ def __init__(
def forward(self, input):
# positions: batch_size x max_len, 把words的index输入就好了
positions = make_positions(input, self.padding_idx)
return super().forward(positions)
return super().forward(positions)

0 comments on commit 00a1894

Please sign in to comment.