卷积前后的大小变化可由以下公式得到:
\(Input: \left(N, C_{i n}, H_{i n}, W_{i n}\right) or \left(C_{i n}, H_{i n}, W_{i n}\right)\) \(Output: \left(N, C_{\text {out }}, H_{\text {out }}, W_{\text {out }}\right) or \left(C_{\text {out }}, H_{\text {out }}, W_{\text {out }}\right)\) \(H_{\text{out} } = \left [\frac{H_{\text{in} }+2\times \text{padding}[0] - {\text{dliation}[0]}\times (\text{kernel\_size}[0]-1)-1 }{\text{stride[0]}}+1\right]\) \(W_{\text{out} } = \left [\frac{W_{\text{in} }+2\times \text{padding}[1] - {\text{dliation}[0]} \times (\text{kernel\_size}[1]-1)-1 }{\text{stride[1]}}+1\right]\)