Comments (4)
me too
from bsconv.
Hi,
as already discussed in issue #4 (bullet point 1) and described in the paper (Sect. 4.2), we retain the layer arrangement of the original model.
However, even though for this specific case the layers are the same, the BSConvS variant uses the additional regularization loss which causes the improved results. This is not shown when printing the model.
from bsconv.
@zeiss-mamthor I want to replace the MobileNetV2 bottleneck ,should I replace DepthwiseConv with BSConvS ?or just replace invert_residual with BSConvS?I ‘m a little confused
from bsconv.
Following the implementation in the paper, the entire linear bottleneck block (not only the DW conv) is replaced by a special form of a BSConvS module, where the layer cascade of PW-PW-DW is shifted to match the original MobileNet design of PW-DW-PW. The reason is that in the MobileNet paper it was shown that residuals in the bottleneck provide a better accuracy/FLOP ratio compared to residuals outside of the bottleneck (as implemented in ResNets). We keep these findings for our models, i.e., converting a MobileNetV2 into its BSConvS variant consists of adding the regularization loss to the last PW conv of each bottleneck block while keeping the overall layer design.
You can simply use the transformer for MobileNetV2/3 which adds the required function to the corresponding modules or just load an already converted model:
import bsconv.pytorch
model = bsconv.pytorch.get_model('cifar_mobilenetv2_w1_bsconvs', num_classes=100)
Btw, do not forget to add the regularization loss during training:
output = model(images)
loss = criterion(output, target)
# THIS LINE MUST BE ADDED, everything else remains unchanged
loss += model.reg_loss(alpha=0.1)
from bsconv.
Related Issues (11)
- aboult BSConv-S HOT 1
- About the PCA in section 3.1 of the paper.
- 5.3. Fine-grained Recognition
- the pictures in the paper HOT 4
- How is BSConv being utilized in MobileNet V2 and V3? HOT 1
- About activation layer and inference: HOT 1
- Ask about adjusting learning rate
- MobileNetv3-large baseline accuracy HOT 1
- scheduling the learning rate for sub_imagenet datasets. HOT 2
- about Figure 2 in paper
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bsconv.