Commit b0582217 authored by MeowZheng's avatar MeowZheng Committed by Wenwei Zhang
Browse files

revise equation in correlation

parent d4615b84
...@@ -117,22 +117,20 @@ class Correlation(nn.Module): ...@@ -117,22 +117,20 @@ class Correlation(nn.Module):
This correlation operator works for optical flow correlation computation. This correlation operator works for optical flow correlation computation.
There are two batched tensors with shape :math:`(N, C, H, W)`, There are two batched tensors with shape :math:`(N, C, H, W)`,
and the correlation output's shape is and the correlation output's shape is :math:`(N, max\_displacement \times
:math:`(N, \text{max\_displacement} \times 2+1, 2 + 1, max\_displacement * 2 + 1, H_{out}, W_{out})`
\text{max\_displacement} \times 2+1,
H_{out}, W_{out})`
where where
.. math:: .. math::
H_{out} = \left\lfloor\frac{H_{in} + 2 \times \text{padding} - H_{out} = \left\lfloor\frac{H_{in} + 2 \times padding -
\text{dilation} \times (\text{kernel\_size} - 1) - 1} dilation \times (kernel\_size - 1) - 1}
{\text{stride}} + 1\right\rfloor {stride} + 1\right\rfloor
.. math:: .. math::
W_{out} = \left\lfloor\frac{W_{in} + 2 \times \text{padding} - W_{out} = \left\lfloor\frac{W_{in} + 2 \times padding - dilation
\text{dilation} \times (\text{kernel\_size} - 1) - 1} \times (kernel\_size - 1) - 1}
{\text{stride}} + 1\right\rfloor {stride} + 1\right\rfloor
the correlation item :math:`(N_i, dy, dx)` is formed by taking the sliding the correlation item :math:`(N_i, dy, dx)` is formed by taking the sliding
window convolution between input1 and shifted input2, window convolution between input1 and shifted input2,
...@@ -146,8 +144,8 @@ class Correlation(nn.Module): ...@@ -146,8 +144,8 @@ class Correlation(nn.Module):
where :math:`\star` is the valid 2d sliding window convolution operator, where :math:`\star` is the valid 2d sliding window convolution operator,
and :math:`\mathcal{S}` means shifting the input features (auto-complete and :math:`\mathcal{S}` means shifting the input features (auto-complete
zero marginal), and :math:`dx, dy` are shifting distance, :math:`dx, dy \in zero marginal), and :math:`dx, dy` are shifting distance, :math:`dx, dy \in
[-\text{max\_displacement} \times \text{dilation\_patch}, [-max\_displacement \times dilation\_patch, max\_displacement \times
\text{max\_displacement} \times \text{dilation\_patch}]`. dilation\_patch]`.
Args: Args:
kernel_size (int): The size of sliding window i.e. local neighborhood kernel_size (int): The size of sliding window i.e. local neighborhood
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment