convnet-aig icon indicating copy to clipboard operation
convnet-aig copied to clipboard

Which part of the computation has been reduced?

Open Vincent-Hoo opened this issue 6 years ago • 1 comments

As stated in the paper, the proposed convnet-aig can reduce computational cost. But after checking the source codes, I found each layer must be executed. The way you skip a single layer is by multiplying a mask (0 or 1) to the output. If that is the case, which part of the convnet-aig can reduce the computation? The code below is cited from convnet_aig.py, line 152, where out is the output of a layer, w[:,1] is the mask.

out = self.shortcut(x) + out * w[:,1].unsqueeze(1)

Vincent-Hoo avatar Dec 18 '18 08:12 Vincent-Hoo

I think its just a proof of concept. It shows that you would lose nothing, if you wouldnt execute the layers when the mask is 0. So its just an implementation detail to actually save on that computation

adrianloy avatar May 31 '19 16:05 adrianloy