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

activation in ReparamLargeKernelConv is not used #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 0 additions & 5 deletions models/modules/replknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def __init__(
groups: int,
small_kernel: int,
inference_mode: bool = False,
activation: nn.Module = nn.GELU(),
) -> None:
"""Construct a ReparamLargeKernelConv module.

Expand All @@ -40,15 +39,13 @@ def __init__(
groups: Group number. Default: 1
small_kernel: Kernel size of small kernel conv branch.
inference_mode: If True, instantiates model in inference mode. Default: ``False``
activation: Activation module. Default: ``nn.GELU``
"""
super(ReparamLargeKernelConv, self).__init__()

self.stride = stride
self.groups = groups
self.in_channels = in_channels
self.out_channels = out_channels
self.activation = activation

self.kernel_size = kernel_size
self.small_kernel = small_kernel
Expand Down Expand Up @@ -84,8 +81,6 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:
out = self.lkb_origin(x)
if hasattr(self, "small_conv"):
out += self.small_conv(x)

self.activation(out)
return out

def get_kernel_bias(self) -> Tuple[torch.Tensor, torch.Tensor]:
Expand Down