9d2cd4feba3fc1031c6b33ac179ec20ee49a5d36,models/mobilenet.py,InvertedResidual,__init__,#InvertedResidual#Any#Any#Any#Any#,43
Before Change
self.use_res_connect = self.stride == 1 and inp == oup
if expand_ratio == 1:
self.conv = nn.Sequential(
// dw
nn.Conv2d(hidden_dim, hidden_dim, 3, stride, 1, groups=hidden_dim, bias=False),
nn.BatchNorm2d(hidden_dim),
nn.ReLU6(inplace=True),
// pw-linear
nn.Conv2d(hidden_dim, oup, 1, 1, 0, bias=False),
nn.BatchNorm2d(oup),
)
else:
self.conv = nn.Sequential(
// pw
nn.Conv2d(inp, hidden_dim, 1, 1, 0, bias=False),
nn.BatchNorm2d(hidden_dim),
nn.ReLU6(inplace=True),
// dw
nn.Conv2d(hidden_dim, hidden_dim, 3, stride, 1, groups=hidden_dim, bias=False),
nn.BatchNorm2d(hidden_dim),
nn.ReLU6(inplace=True),
// pw-linear
nn.Conv2d(hidden_dim, oup, 1, 1, 0, bias=False),
nn.BatchNorm2d(oup),
)
def forward(self, x):
After Change
self.use_res_connect = self.stride == 1 and inp == oup
if expand_ratio == 1:
self.conv = nn.Sequential(
// dw
nn.Conv2d(hidden_dim, hidden_dim, 3, stride, 1, groups=hidden_dim, bias=False),
SynchronizedBatchNorm2d(hidden_dim),
nn.ReLU6(inplace=True),
// pw-linear
nn.Conv2d(hidden_dim, oup, 1, 1, 0, bias=False),
SynchronizedBatchNorm2d(oup),
)
else:
self.conv = nn.Sequential(
// pw
nn.Conv2d(inp, hidden_dim, 1, 1, 0, bias=False),
SynchronizedBatchNorm2d(hidden_dim),
nn.ReLU6(inplace=True),
// dw
nn.Conv2d(hidden_dim, hidden_dim, 3, stride, 1, groups=hidden_dim, bias=False),
SynchronizedBatchNorm2d(hidden_dim),
nn.ReLU6(inplace=True),
// pw-linear
nn.Conv2d(hidden_dim, oup, 1, 1, 0, bias=False),
SynchronizedBatchNorm2d(oup),
)
def forward(self, x):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 11
Instances
Project Name: CSAILVision/semantic-segmentation-pytorch
Commit Name: 9d2cd4feba3fc1031c6b33ac179ec20ee49a5d36
Time: 2018-12-03
Author: zhaohang0124@gmail.com
File Name: models/mobilenet.py
Class Name: InvertedResidual
Method Name: __init__
Project Name: CSAILVision/semantic-segmentation-pytorch
Commit Name: 9d2cd4feba3fc1031c6b33ac179ec20ee49a5d36
Time: 2018-12-03
Author: zhaohang0124@gmail.com
File Name: models/mobilenet.py
Class Name: InvertedResidual
Method Name: __init__
Project Name: CSAILVision/semantic-segmentation-pytorch
Commit Name: 454e9b53b8526a660517584a03aa6fd65e9487de
Time: 2018-12-01
Author: zhaohang0124@gmail.com
File Name: models/mobilenet.py
Class Name: InvertedResidual
Method Name: __init__
Project Name: CSAILVision/semantic-segmentation-pytorch
Commit Name: 6324799d51a451995a91b76306eae40ccd11f55e
Time: 2018-03-27
Author: jasonhsiao97@gmail.com
File Name: resnet.py
Class Name: Bottleneck
Method Name: __init__