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

When to use slimconv? #2

Open
Senwang98 opened this issue Jan 9, 2021 · 8 comments
Open

When to use slimconv? #2

Senwang98 opened this issue Jan 9, 2021 · 8 comments

Comments

@Senwang98
Copy link

Hi,
Thanks for your work, I want to know if I use slimconv to my model, Is there need to replace all the conv to slimconv?
The question is when should I use slimconv to replace conv?

@JiaxiongQ
Copy link
Owner

Thanks for your attention, you can use our slimconv to replace the normal 3x3 conv, but the following layer should better be 1x1 conv to rise the dimension of features.

@Senwang98
Copy link
Author

Hi, @JiaxiongQ
请问是否一定要在做完slim_conv之后立马接一个conv11,比如我的特征图通道数是64,那么slim_conv之后拿48通道数的特征图做一些进一步处理之后,再接一个conv11恢复成64,这样可以吗?这么做只是为了减少参数。

如果做完slim_conv之后直接用conv1*1,那么似乎并没有带来计算参数上面的优势???

@JiaxiongQ
Copy link
Owner

JiaxiongQ commented Jan 17, 2021 via email

@zsureuk
Copy link

zsureuk commented Feb 12, 2021

Hi @JiaxiongQ
您好,首先非常感谢您能够提出非常优秀的卷积结构。
我尝试着复现您在resnet20的结果,于是修改您分享的SC-ResNet.py文件以便它能够在cifar数据集上运行,我把最终3/4C的通道直接还原成了完整的C通道(也就是把下路的1/4C扩到了1/2C)。然而我复现得到的resent20的实验结果(90.55%)远小于base model的精度(92.04%)。
我使用的训练参数是:SGD with weight decay= 5e-4, batch-size = 128, initial learning rate = 0.1 然后每50epochs降低为原来的0.1。
同样在这种情况在resnet56也是如此。请问我复现使用的参数跟您之前做的时候比有什么疏漏的地方吗?
您可否分享一下关于cifar的训练和模型文件呢?
非常期待作者的回复。

@JiaxiongQ
Copy link
Owner

JiaxiongQ commented Feb 13, 2021 via email

@JiaxiongQ
Copy link
Owner

JiaxiongQ commented Feb 13, 2021 via email

@zsureuk
Copy link

zsureuk commented Feb 13, 2021

@JiaxiongQ 非常感谢您的回复
在您的附近里我发现有这样两行代码:
if cnt>-1:
self.conv1 = myconv_3x3R(in_planes,stride=stride, kernel_size=3, padding=1, bias=False)
请问myconv_3x3R是class slim_conv_3x3(nn.Module)吗?还是另外定义的卷积呢?另外请问cnt是有什么特殊含义吗?
对于cifar这种每个basicblock只包含两个3x3的卷积的resent,等于说是只改动第一个3x3卷积,第二个3x3是为了恢复成C通道的常规3x3卷积哈

@JiaxiongQ
Copy link
Owner

JiaxiongQ commented Feb 15, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants