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

about MACs #1

Open
Sunshine-Ye opened this issue Jul 13, 2020 · 3 comments
Open

about MACs #1

Sunshine-Ye opened this issue Jul 13, 2020 · 3 comments

Comments

@Sunshine-Ye
Copy link

thanks the authors for this promising work!

In the paper, the convolution in the ith head is conducted with only the selected emphasized channels and the corresponding filters:
image

In the code, the unselected channels is also computed with the corresponding filters, instead the unselected channels is masked with 0:
image
image

I want know if the actual MACs or flops or computation-cost are effectively reduced in the pytorch implementation?

@hellozhuo
Copy link
Owner

Yes you are right, the prunned input channels are simply assigned as 0s for training convenience, therefore the MACs are not reduced in this implementation. In order to achieve the theoretical computation reduction in the testing phase, as discussed at the end of the paper, a dynamic version of "index layer" should be applied, which is supposed to gather the selected channels to form the input for the group convolution. We also suggest you to refer to the the discussion of index layer in condensenet and FLGC.

@Sunshine-Ye
Copy link
Author

how to achieve a dynamic version of "index layer"? i mean, how to realize it in pytorch? the index layer in condensenet and FLGC is "static" while it is "dynamic" in DGC, how to achieve the theoretical computation reduction in the testing phase?
look forward for your reply, an example with pytorch code may be better.

@hellozhuo
Copy link
Owner

hellozhuo commented Jul 13, 2020

@Sunshine-Ye In Pytroch framework, you could use something like index select once you get the indices of the selected channels. This works when batch size is 1. For batch size > 1, it is true a problem at least under the current Pytorch framework, because individual sample has its different filters corresponding to the selected channels. We are also looking forward to new solutions.

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

2 participants