Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunwoongko authored Dec 7, 2022
1 parent 93fa081 commit ef99322
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,16 @@ class EncoderLayer(nn.Module):
x = self.attention(q=x, k=x, v=x, mask=src_mask)

# 2. add and norm
x = self.norm1(x + _x)
x = self.dropout1(x)
x = self.norm1(x + _x)

# 3. positionwise feed forward network
_x = x
x = self.ffn(x)

# 4. add and norm
x = self.norm2(x + _x)
x = self.dropout2(x)
x = self.norm2(x + _x)
return x
```
<br>
Expand Down Expand Up @@ -298,25 +298,25 @@ class DecoderLayer(nn.Module):
x = self.self_attention(q=dec, k=dec, v=dec, mask=trg_mask)

# 2. add and norm
x = self.norm1(x + _x)
x = self.dropout1(x)
x = self.norm1(x + _x)

if enc is not None:
# 3. compute encoder - decoder attention
_x = x
x = self.enc_dec_attention(q=x, k=enc, v=enc, mask=src_mask)

# 4. add and norm
x = self.norm2(x + _x)
x = self.dropout2(x)
x = self.norm2(x + _x)

# 5. positionwise feed forward network
_x = x
x = self.ffn(x)

# 6. add and norm
x = self.norm3(x + _x)
x = self.dropout3(x)
x = self.norm3(x + _x)
return x
```
<br>
Expand Down

0 comments on commit ef99322

Please sign in to comment.