Skip to content
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
1 change: 1 addition & 0 deletions timm/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from .sknet import *
from .tresnet import *
from .resnest import *
from .regnet import *

from .registry import *
from .factory import create_model
Expand Down
4 changes: 2 additions & 2 deletions timm/models/layers/se.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

class SEModule(nn.Module):

def __init__(self, channels, reduction=16, act_layer=nn.ReLU):
def __init__(self, channels, reduction=16, act_layer=nn.ReLU, min_channels=8, reduction_channels=None):
super(SEModule, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
reduction_channels = max(channels // reduction, 8)
reduction_channels = reduction_channels or max(channels // reduction, min_channels)
self.fc1 = nn.Conv2d(
channels, reduction_channels, kernel_size=1, padding=0, bias=True)
self.act = act_layer(inplace=True)
Expand Down
Loading