Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typos #16

Merged
merged 1 commit into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions wenet/transformer/convolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

class ConvolutionModule(nn.Module):
"""ConvolutionModule in Conformer model."""

def __init__(self,
channels: int,
kernel_size: int = 15,
Expand Down Expand Up @@ -44,7 +43,7 @@ def __init__(self,
padding = 0
self.lorder = kernel_size - 1
else:
# kernerl_size should be an odd number for none causal convolution
# kernel_size should be an odd number for none causal convolution
assert (kernel_size - 1) % 2 == 0
padding = (kernel_size - 1) // 2
self.lorder = 0
Expand Down
2 changes: 1 addition & 1 deletion wenet/transformer/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def __init__(
compatibility.
activation_type (str): Encoder activation function type.
use_cnn_module (bool): Whether to use convolution module.
cnn_module_kernel (int): Kernerl size of convolution module.
cnn_module_kernel (int): Kernel size of convolution module.
causal (bool): whether to use causal convolution or not.
"""
assert check_argument_types()
Expand Down
4 changes: 2 additions & 2 deletions wenet/transformer/positionwise_feed_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ def __init__(self,
hidden_units: int,
dropout_rate: float,
activation: torch.nn.Module = torch.nn.ReLU()):
"""Construct an PositionwiseFeedForward object."""
"""Construct a PositionwiseFeedForward object."""
super(PositionwiseFeedForward, self).__init__()
self.w_1 = torch.nn.Linear(idim, hidden_units)
self.w_2 = torch.nn.Linear(hidden_units, idim)
self.dropout = torch.nn.Dropout(dropout_rate)
self.activation = activation

def forward(self, x: torch.Tensor) -> torch.Tensor:
"""Forward funciton."""
"""Forward function."""
return self.w_2(self.dropout(self.activation(self.w_1(x))))
2 changes: 1 addition & 1 deletion wenet/transformer/swish.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
class Swish(torch.nn.Module):
"""Construct an Swish object."""
def forward(self, x: torch.Tensor) -> torch.Tensor:
"""Return Swich activation function."""
"""Return Swish activation function."""
return x * torch.sigmoid(x)
2 changes: 1 addition & 1 deletion wenet/utils/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Unility funcitons for Transformer."""
"""Unility functions for Transformer."""

import math
from typing import Tuple, List
Expand Down