Skip to content

Commit

Permalink
Update encoder.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sooftware authored May 30, 2021
1 parent d574f66 commit 9451bb1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kospeech/models/transformer/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def __init__(
self.num_layers = num_layers
self.num_heads = num_heads
self.input_proj = Linear(self.conv_output_dim, d_model)
self.input_layer_norm = LayerNorm(d_model)
self.input_dropout = nn.Dropout(p=dropout_p)
self.positional_encoding = PositionalEncoding(d_model)
self.layers = nn.ModuleList([
Expand Down Expand Up @@ -141,7 +140,7 @@ def forward(self, inputs: Tensor, input_lengths: Tensor) -> Tuple[Tensor, Tensor

self_attn_mask = get_attn_pad_mask(conv_outputs, output_lengths, conv_outputs.size(1))

outputs = self.input_layer_norm(self.input_proj(conv_outputs))
outputs = self.input_proj(conv_outputs)
outputs += self.positional_encoding(outputs.size(1))
outputs = self.input_dropout(outputs)

Expand Down

0 comments on commit 9451bb1

Please sign in to comment.