acheun9 / pytorch-implementation-of-mobile-former Goto Github PK
View Code? Open in Web Editor NEWSimple implementation of Mobile-Former on Pytorch
Simple implementation of Mobile-Former on Pytorch
class Mobile(nn.Module):
def init(self, ks, inp, hid, out, se, stride, dim, reduction=4, k=2):
hi, call you tell me, the k value why equal to 2, What is it used for
Great job!
However, I think there are probably two tiny issues in you code.
The first one is in bridge.py
(line 24 & line 53). I think there are some differences in the following two lines of code
x = x.reshape(b, c, h*w).transpose(1,2).unsqueeze(1)
x = x.contiguous().view(b, h * w, c).unsqueeze(1)
May be the first line is correct?
The second one is in config.py
.Accroding to the original paper, in page 13,
Figure 7. Visualization of cross attention on the two-way bridge: Mobile→Former and Mobile←Former. Mobile-Former-294M is used,which includes 6 tokens (each corresponds to a column) and 11 Mobile-Former blocks (block 2–12) across 4 stages. Each block has two attention heads that are visualized in two rows. Attention in Mobile→Former (left half) is normalized over pixels, showing the focused region per token. Attention in Mobile←Former (right half) is normalized over tokens showing the contribution per token at each pixel.
But in config.py
, there are some stages with only one head.
I'm not sure whether the above is correct. Looking forward to your reply!
Hi, I want to extend the model on my own task, will you release pre-trained weights?
您好,问一下,这个实现中关于transformer的部分是没有考虑位置编码吗?
请问作者是什么电脑配置跑这个模型的啊,2080ti能带动吗?
Great job!
However, i try the training on imagent and it does not converge.
I also try another implement https://github.com/slwang9353/MobileFormer and it does not converge either.
Does anyone successfully reproduce the results in the paper?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.