如何计算单个 CNN 层中的权重和偏差值的数量?
How can I calculate the number of weights and bias values in a single CNN layer?
给定下图,我该如何计算参数的个数:
CNN Layer
这个特定的层由 4x4 卷积和 64 个特征图组成;我怎样才能完成满足我最初问题的计算?
Update - Full Architecture
过滤器大小包含 N * kernel_size * kernel_size
个权重参数,每个通道一个,因此
N * kernel_size * kernel_size* n_channels
然后 N bais parmaters 所以这一层的最终计算是 n_params = N * kernel_size * kernel_size* n_channels + N
N : number of features
kernel_size : is conv2d shape (height and width)
n_channels : is the number of channels
n_params : is the total number of your parameters
Ex
n_params = 64 * (4 * 4) * 3 + 64 = 3136
给定下图,我该如何计算参数的个数:
CNN Layer
这个特定的层由 4x4 卷积和 64 个特征图组成;我怎样才能完成满足我最初问题的计算?
Update - Full Architecture
过滤器大小包含 N * kernel_size * kernel_size
个权重参数,每个通道一个,因此
N * kernel_size * kernel_size* n_channels
然后 N bais parmaters 所以这一层的最终计算是 n_params = N * kernel_size * kernel_size* n_channels + N
N : number of features
kernel_size : is conv2d shape (height and width)
n_channels : is the number of channels
n_params : is the total number of your parameters
Ex
n_params = 64 * (4 * 4) * 3 + 64 = 3136