liuzhuang13 / DenseNet

Densely Connected Convolutional Networks, In CVPR 2017 (Best Paper Award).
BSD 3-Clause "New" or "Revised" License
4.69k stars 1.06k forks source link

What is proper way of counting parameters? #38

Closed Lyken17 closed 6 years ago

Lyken17 commented 6 years ago

Hi author, as you claimed in both repo and paper, the numer of parameters of densenet-100-12 is 7.0M and densenet-100-24 is 27.72M. However when I examine the parameters in following way

-- main.lua, line 32
-- Create model
local model, criterion = models.setup(opt, checkpoint)

params = model:getParameters()
print(#params)

I got 4.06M for densenet-100-12 and 16.11M for densenet-100-24. Did I count it in a wrong way?

liuzhuang13 commented 6 years ago

Hi, did you use the bottleneck structure? Can you show me the model definition?

Lyken17 commented 6 years ago

No, all models are not using BC structure.

Here are the model definitions. 40-12-no-bc.txt 100-12-no-bc.txt 100-24-no-bc.txt

liuzhuang13 commented 6 years ago

You seemed to be using reduction_rate = 0.5. In our non-BC structures, the reduction rate is 1, which means no channel reduction at transition layer.

Lyken17 commented 6 years ago

Thank you! I see where my mistake is.