Question about reporting likelihoods in bits per dim
Hi all,
Thank you for providing this code, it's very educational :)
I am interested in reporting likelihoods but I don't fully understand how bits per dim are calculated. In the code this is
bpd = -(prior_logp + delta_logp) / np.log(2)
N = np.prod(shape[1:])
bpd = bpd / N
# A hack to convert log-likelihoods to bits/dim
offset = 7. - inverse_scaler(-1.)
bpd = bpd + offset
Would you be able to elaborate on how this hack works and if it applies to other image dimensions?
Best, Matt
same question here.
same question here as well Edit: I think this hack applies to images which originally have discrete pixel intensities from 0 to 255. See, e.g., equations 3 to 5 in Danihelka et al. (https://arxiv.org/pdf/1705.05263.pdf).
@mareikethies Thanks a lot! I got it.
@mareikethies Thank you, it looks like this offset doesn't apply to other data types :0