Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
moskomule committed Dec 31, 2018
1 parent 8a265cd commit 9d279ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ python cifar.py [--baseline]

### SE-ResNet50/ImageNet

*The initial learning rate and mini-batch size are different from the original version because of my computational resource* (0.6 to 0.1 and 1024 to 128 respectively).
*The initial learning rate and mini-batch size are different from the original version because of my computational resource* .

| | ResNet | SE-ResNet |
|:------------- | :------------- | :------------- |
|max. test accuracy(top1)| 79.26 %(*) | 71.66 %(**) |
|max. test accuracy(top1)| 76.15 %(*) | -- (**) |


+ (*): He, K., Zhang, X., Ren, S., & Sun, J. (2015). Deep Residual Learning for Image Recognition.
+ (*): [ResNet-50 in torchvision](https://pytorch.org/docs/stable/torchvision/models.html)

+ (**): I share [this weight (training after 100 epochs)](https://drive.google.com/file/d/1WhBKRKIRtd-Fsrj3hx_WNycdsZSbC9Ep).
+ (**): When using `imagenet.py` in the `--distributed` setting on 8 GPUs. The weight will be available soon.

```python
senet = se_resnet50(num_classes=1000)
Expand Down
10 changes: 5 additions & 5 deletions senet/se_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ def __init__(self, channel, reduction=16):
super(SELayer, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.fc = nn.Sequential(
nn.Linear(channel, channel // reduction),
nn.ReLU(inplace=True),
nn.Linear(channel // reduction, channel),
nn.Sigmoid()
nn.Linear(channel, channel // reduction, bias=False),
nn.ReLU(inplace=True),
nn.Linear(channel // reduction, channel, bias=False),
nn.Sigmoid()
)

def forward(self, x):
b, c, _, _ = x.size()
y = self.avg_pool(x).view(b, c)
y = self.fc(y).view(b, c, 1, 1)
return x * y
return x * y.expand_as(x)

0 comments on commit 9d279ec

Please sign in to comment.