didriknielsen / survae_flows

Code for paper "SurVAE Flows: Surjections to Bridge the Gap between VAEs and Flows"
MIT License
283 stars 34 forks source link

Bug in StandardUniform #19

Open mkirchler opened 2 years ago

mkirchler commented 2 years ago

Hi, probably not a big issue as most people don't use the uniform distribution, but I think the log-prob is wrong. It should return -inf if any element of a data point is outside the bounds, but currently, it just averages how many are out of bounds. For example:

unif = StandardUniform((2,))
x = torch.tensor([-0.5, 0.5])
unif.log_prob(x)
# returns -0.69 but should be -inf