如何在单个CNN层中计算权重和偏差值的数量?

时间:2020-06-01 09:41:14

标签: machine-learning neural-network conv-neural-network feature-extraction

鉴于下图,如何计算参数数量:

CNN Layer

该特定层由4x4卷积和64个特征图组成;如何完成可以满足我的最初问题的计算?

Update - Full Architecture

1 个答案:

答案 0 :(得分:1)

过滤器大小包含N * kernel_size * kernel_size个权重参数,每个通道一个,因此

N * kernel_size * kernel_size* n_channels然后 N bais parmaters,因此该层的最终cacluation为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

相关问题