I want to compute a pixel-wise loss by summing up distances to pixels neighbors. Is there a “sliding window” manner to do that with Pytorch?
You could probably use unfold
to get the image patches and calculate the loss on these.
Have a look at this post for an example.
1 Like
Thank u so much! :))
1 Like