Skip to content

Commit ea2e59c

Browse files
authored
Merge pull request #150 from rwightman/regnet
Add RegNet models and weights
2 parents dab9935 + 50658b9 commit ea2e59c

File tree

3 files changed

+488
-2
lines changed

3 files changed

+488
-2
lines changed

timm/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from .sknet import *
2020
from .tresnet import *
2121
from .resnest import *
22+
from .regnet import *
2223

2324
from .registry import *
2425
from .factory import create_model

timm/models/layers/se.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
class SEModule(nn.Module):
55

6-
def __init__(self, channels, reduction=16, act_layer=nn.ReLU):
6+
def __init__(self, channels, reduction=16, act_layer=nn.ReLU, min_channels=8, reduction_channels=None):
77
super(SEModule, self).__init__()
88
self.avg_pool = nn.AdaptiveAvgPool2d(1)
9-
reduction_channels = max(channels // reduction, 8)
9+
reduction_channels = reduction_channels or max(channels // reduction, min_channels)
1010
self.fc1 = nn.Conv2d(
1111
channels, reduction_channels, kernel_size=1, padding=0, bias=True)
1212
self.act = act_layer(inplace=True)

0 commit comments

Comments
 (0)