Concept

A Convolution Layer Output Size and Parameters

Input size =nh[l1]×nw[l1]×nc[l1]= n_h^{[l-1]} \times n_w^{[l-1]} \times n_c^{[l-1]} Kernel size =fh[l]×fw[l]×nc[l]= f_h^{[l]} \times f_w^{[l]} \times n_c^{[l]} Where nc[l]=n_c^{[l]} = number of filters in layer ll because it should match the number of outputs. Stride size =sh[l]×sw[l]= s_h^{[l]} \times s_w^{[l]} Padding size =ph[l]×pw[l]= p_h^{[l]} \times p_w^{[l]}

Output (Activations a[l]a^{[l]}) size =nh[l]×nw[l]×nc[l]= n_h^{[l]} \times n_w^{[l]} \times n_c^{[l]} nh[l]=nh[l1]+2ph[l]kh[l]sh[l]+1n_h^{[l]} = \left \lfloor{ \frac{n_h^{[l-1]} + 2p_h^{[l]} − k_h^{[l]}}{s_h^{[l]}}}\right \rfloor + 1 nw[l]=nw[l1]+2pw[l]kw[l]sw[l]+1n_w^{[l]} = \left \lfloor{ \frac{n_w^{[l-1]} + 2p_w^{[l]} − k_w^{[l]}}{s_w^{[l]}}}\right \rfloor + 1

# of Parameters: Weights: fh[l]×fw[l]×nc[l1]×nc[l]f_h^{[l]} \times f_w^{[l]} \times n_c^{[l-1]} \times n_c^{[l]} Bias: nc[l]n_c^{[l]}

0

1

Updated 2021-04-14

Tags

Data Science