H
′
=
(
H
−
K
[
0
]
)
S
[
0
]
+
1
W
’
=
(
W
−
K
[
1
]
)
S
[
1
]
+
1
\begin{aligned}\\ H' &= \frac{(H-K[0])}{S[0]} + 1 \\ \\ W’ &=\frac{(W-K[1])}{S[1]} + 1 \end{aligned}
H′W’=S[0](H−K[0])+1=S[1](W−K[1])+1
其中:
ps:这里的除法为向上取整
H ′ = ( H − K [ 0 ] + 2 ∗ P a d [ 0 ] ) S [ 0 ] + 1 W ’ = ( W − K [ 1 ] + 2 ∗ P a d [ 1 ] ) S [ 1 ] + 1 \begin{aligned}\\ H' &= \frac{(H-K[0] + 2*Pad[0])}{S[0]} + 1 \\ \\ W’ &=\frac{(W-K[1] + 2*Pad[1])}{S[1]} + 1 \end{aligned} H′W’=S[0](H−K[0]+2∗Pad[0])+1=S[1](W−K[1]+2∗Pad[1])+1
其中:
ps:pytorch卷积操作中的默认填充方式为(上下、左右)对称0填充
,且具体操作流程为先填充后卷积
。
H ′ = ( H − K [ 0 ] + P a d [ 0 ] + P a d [ 1 ] ) S [ 0 ] + 1 W ’ = ( W − K [ 1 ] + P a d [ 2 ] + P a d [ 3 ] ) S [ 1 ] + 1 \begin{aligned}\\ H' &= \frac{(H-K[0] + Pad[0] + Pad[1])}{S[0]} + 1 \\ \\ W’ &=\frac{(W-K[1] + Pad[2] + Pad[3])}{S[1]} + 1 \end{aligned} H′W’=S[0](H−K[0]+Pad[0]+Pad[1])+1=S[1](W−K[1]+Pad[2]+Pad[3])+1
其中: