Formula

Convolution Layer Output Size and Parameter Formulas

For a convolutional layer ll, the output dimensions and number of parameters are calculated as follows:

Input Size: nh[l1]imesnw[l1]imesnc[l1]n_h^{[l-1]} imes n_w^{[l-1]} imes n_c^{[l-1]} Filter (Kernel) Size: kh[l]imeskw[l]imesnc[l1]k_h^{[l]} imes k_w^{[l]} imes n_c^{[l-1]} *(Note: nc[l]n_c^{[l]} is the number of filters in layer ll, matching the number of output channels.) Stride: sh[l]imessw[l]s_h^{[l]} imes s_w^{[l]} Padding: ph[l]imespw[l]p_h^{[l]} imes p_w^{[l]}

Output (Activations a[l]a^{[l]}) Size: nh[l]imesnw[l]imesnc[l]n_h^{[l]} imes n_w^{[l]} imes n_c^{[l]}

ight floor + 1$$ $$n_w^{[l]} = \left \lfloor \frac{n_w^{[l-1]} + 2p_w^{[l]} - k_w^{[l]}}{s_w^{[l]}} ight floor + 1$$ Number of Parameters: Weights: $$k_h^{[l]} imes k_w^{[l]} imes n_c^{[l-1]} imes n_c^{[l]}$$ * Biases: $$n_c^{[l]}$$

0

1

Updated 2026-05-09

Tags

Data Science