aitom
aitom copied to clipboard
Logic error in code
In the file saliency_detection.py, at line 384, the distance formulae were expected to be from page 4 of the source paper by Zhou B. et al. However, the weight coefficient is omitted from the code. As varying the weight coefficient results in comparatively different outputs, I wanted to know whether the omission was intended or not. We have integrated the weight coefficient as such,
D = math.sqrt(dc2 + w * ds2 * math.pow(m/interval , 2) )
D1 = math.sqrt(dc2 + ds2 * (m1 / interval) ** 2)
D2 = math.sqrt(dc2 + w * ds2 * math.pow(m2/interval , 2) )
Because here m, interval, and w depend on 3 independent hyperparameters, these two ways of writing differ by only one constant. Specifically,
math.pow(m1 , 2) == w * math.pow(m2 , 2)
You can change m1 to vary the weight coefficient to get different outputs.