Closed offbit closed 8 years ago
Thanks for opening this issue. The function addLayer() does require nOutChannels, and we use this param to denote number of newly learned feature maps at this layer, which is equal to the growth rate.
Superficially, there's only n-1 connections, but in function addLayer(), every time the new feature maps learned by this layer, concated with all previous layers' feature maps, are passed to subsequent layers, through the use of nn.Identity() and nn.Concat(). It's equivalent to the connection pattern described in paper. This is for ease of implementation, one can also keep a set of each layer's feature maps and every time first concate them then do convolution, but that's a little more compilcated to implement.
This may be a question for many people, thanks for pointing out!
Excellent :) I think I didn't pay much attention, and had in mind the residual connection type. But yes, concat makes perfect sense!
Thanks for the clarifications.
Hi,
check out the code at
https://github.com/liuzhuang13/DenseNet/blob/master/densenet.lua#L54
param requires nOutChannels, but you pass growth rate.
Also add layer only adds direct connection to the next layer, so you form n-1 connections, as far as I understood from your paper it should have n-2, n-3 , etc... for every layer in the block. I'm guessing this is not the version you used to train the models.
Thanks for sharing.