lcn
lcn copied to clipboard
nan in output
https://github.com/anthonymlortiz/lcn/blob/master/local_context_norm.py#L40
if
squares < sums*sums/n
var becomes negative so when you take square root later in padded_vars it leads to nan results
would adding
var = torch.abs(var)
make sense
The variance should never be negative. I had the same problem, in my case it was caused by overflow because I was using float16.