GUOShuxuan / expandnets

Official implementation of ExpandNets (NeurIPS2020)
https://proceedings.neurips.cc/paper/2020/hash/0e1ebad68af7f0ae4830b7ac92bc3c6f-Abstract.html
BSD 3-Clause "New" or "Revised" License
36 stars 6 forks source link

The compute function seems to have some errors #3

Closed hiterjoshua closed 3 years ago

hiterjoshua commented 3 years ago

Hi there, Great Jobs! Still, when I tried the compute_ck, compute_cl and compute_cl_2 functions, it seems two of them have some errors compared to the origin network output.

The code link is below, pretrained network layers from official torchvision used for calculation. https://github.com/hiterjoshua/BasicSR/blob/master/tests/expand_net.py

Directly run the upper expand_net.py and you would get the output of error: error 3*3 and 3*3: -80360.1015625 error 3*3 and 1*1: 0.20960576832294464 error 1*1 and 3*3: -2098.904541015625

It seems the functions error 3*3 and 3*3 and 1*1 and 3*3 have some errors here, would you take a look at this problem? Hoping your answer! Thanks!

hiterjoshua commented 3 years ago

@GUOShuxuan Also I find one fact that dummy.test file you provided, all of the convolution layers donot have padding, and once I add a padding to the conv function, the error will get much larger(from 0.00000x to 26.8970146).

Waitting for your response, Thanks!

GUOShuxuan commented 3 years ago

@GUOShuxuan Also I find one fact that dummy.test file you provided, all of the convolution layers donot have padding, and once I add a padding to the conv function, the error will get much larger(from 0.00000x to 26.8970146).

Waitting for your response, Thanks!

Hi, we discuss the padding and stride in our paper section 3.2. The padding is only applied to the first layer of our expand unit, otherwise the computation is not exactly linear.

GUOShuxuan commented 3 years ago

Hi there, Great Jobs! Still, when I tried the compute_ck, compute_cl and compute_cl_2 functions, it seems two of them have some errors compared to the origin network output.

The code link is below, pretrained network layers from official torchvision used for calculation. https://github.com/hiterjoshua/BasicSR/blob/master/tests/expand_net.py

Directly run the upper expand_net.py and you would get the output of error: error 3*3 and 3*3: -80360.1015625 error 3*3 and 1*1: 0.20960576832294464 error 1*1 and 3*3: -2098.904541015625

It seems the functions error 3*3 and 3*3 and 1*1 and 3*3 have some errors here, would you take a look at this problem? Hoping your answer! Thanks!

Hi, I have a quick look on your code, here might be some problem in your code:

If you still have some questions, I will try to help once I have time because I am busy these days.

Cheers!

hiterjoshua commented 3 years ago

er section 3.2. The padding is only applied to the first layer of our expand unit, otherwise the computation is not exactly line

@GUOShuxuan Also I find one fact that dummy.test file you provided, all of the convolution layers donot have padding, and once I add a padding to the conv function, the error will get much larger(from 0.00000x to 26.8970146). Waitting for your response, Thanks!

Hi, we discuss the padding and stride in our paper section 3.2. The padding is only applied to the first layer of our expand unit, otherwise the computation is not exactly linear.

Thank you! Previously the paper I read is from website Researchgate, it turns out that the paper on web arxiv has much more information. Follow your instruction in arxiv paper section 3.2, I get the desired results! Really amazing work! A LOT THANKS TO YOU!