junzis / contrail-seg

Neural network models for contrail detection and segmentation
GNU General Public License v3.0
9 stars 1 forks source link

the hough transform does not track the gradient #1

Open Rit-Shi opened 1 month ago

Rit-Shi commented 1 month ago

In the hough transform portion of the loss, the output hough_matrices of the hough_transform function does not track the gradient, so the gradient is not backpropagated through the hough_transform function when computing the loss.

hough_matrix = torch.where(accumulator > threshold, 1, 0)
Rit-Shi commented 1 month ago

sorry, 'troch.where' track the grad , if the input tensor tracks the gradient. But

points = torch.argwhere(img > 0.5).type_as(cos_thetas)

the index returned by torch.argwhere does not track the gradient, so the output of the 'hough_transform' func does not track the gradient.