huawei-noah / AdderNet

Code for paper " AdderNet: Do We Really Need Multiplications in Deep Learning?"
BSD 3-Clause "New" or "Revised" License
952 stars 187 forks source link

询问部署到MobileNet上的问题 #70

Open Jerryme-xxm opened 1 year ago

Jerryme-xxm commented 1 year ago

您好,最近我想试试部署adder到mobilenet v2网络里,但是遇到了点问题,请问可以帮我解答吗。

我用这里的源码(训练参数对齐)跑resnet,精度和report里差不多。但是当我把mobilenet v2的pointwise层(depthwise要改为群卷积,准备等pointwise没问题再改)替换成adder-conv2d后,精度会有2%的下降。

我没有替换开头和末尾两层。请问精度下降2%会是什么原因呢? 会不会是残差的问题,需要每一层都有残差吗(mobilenet v2若是stride=2或维度变化,就没有残差了)?

HantingChen commented 1 year ago

你好,小网络由于本身冗余度就比较低,替换为adder后精度会下降比较多。

DavideHe commented 6 months ago

感觉可以所有的卷积(包括1x1的)都换成adder,不要一会addernet一会一般卷积,因为addernet是计算1范式距离,但是1x1的卷积算的是余弦距离,混用可能导致不好的结果