MiDaS
MiDaS copied to clipboard
Implementation detail of the robust loss
Looking at https://gist.github.com/ranftlr/1d6194db2e1dffa0a50c9b0a9549cbd2#file-loss-py-L31, it looks like you are computing the median over all the values, including invalid ones. Shouldn't this be a masked median? (It is not available off the shelf, but can be implemented efficiently in a roundabout way). And if it's a bug / feature, then how does it relate to trimming? Meaning the outliers may be coming from invalid values or the invalid values may make legal values look like outliers...
I am wondering if the part
trimmed, _ = torch.sort(res.view(-1), descending=False)[ : int(len(res) * (1.0 - trim)) ]
should be changed to
trimmed, _ = torch.sort(res.view(-1), descending=False)
trimmed = trimmed[: int(len(res.view(-1)) * (1.0 - trim))]
I am wondering if the part
trimmed, _ = torch.sort(res.view(-1), descending=False)[ : int(len(res) * (1.0 - trim)) ]should be changed to
trimmed, _ = torch.sort(res.view(-1), descending=False)trimmed = trimmed[: int(len(res.view(-1)) * (1.0 - trim))]
I think it should be changed to the second one, the first line won't perform trimming.
@dfrumkin Hi Guys, I wonder are you able to reproduce the training script. I am pretty to this and wonder how you achieved this. Thanks.
Same problem.