From bcff06f9c266a60e399f8346fc5b8d223a2079ac Mon Sep 17 00:00:00 2001 From: rubberhead Date: Tue, 30 Jan 2024 17:06:29 +0000 Subject: [PATCH] Added comments --- model/reverse_perspective.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/model/reverse_perspective.py b/model/reverse_perspective.py index 472551e..4a95b2e 100644 --- a/model/reverse_perspective.py +++ b/model/reverse_perspective.py @@ -26,6 +26,21 @@ class PerspectiveEstimator(nn.Module): Input: Pre-processed, uniformly-sized image data Output: Perspective factor + **Note** + -------- + Loss input needs to be computed from beyond the **entire** rev-perspective + network. Needs to therefore compute: + - Effective pixel of each row after transformation. + - Feature density (count) along row, summed over column. + + Loss is computed as a variance over row feature densities. Ref. paper 3.2. + After all, it is reasonable to say that you see more when you look at + faraway places. + + This do imply that **we need to obtain a reasonably good feature extractor + from general images before training this submodule**. Hence, for now, we + prob. should work on transformer first. + :param input_shape: (N, C, H, W) :param conv_kernel_shape: Oriented as (H, W) :param conv_dilation: equidistance dilation factor along H, W @@ -96,3 +111,5 @@ class PerspectiveEstimator(nn.Module): out = torch.exp(-out) + self.epsilon return out + +