kamenbliznashki / normalizing_flows

Pytorch implementations of density estimation algorithms: BNAF, Glow, MAF, RealNVP, planar flows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typos?

dmelis opened this issue · comments

Hi, thanks for the implementation.

Two issues/questions:

  1. Shouldn't there be a log in L515 in maf.py?
  2. In that same function (evaluate), labels is created but never used. The same (true) y is used for every step of the outside for. Seems like it should be model.log_prob(x, labels) in L527, and also, L521 should be labels[:,i] = 1

Yes, thanks for pointing it out and correcting!
Re 1 - the log prior under a uniform prior for the labels is log(1/n_labels) as you point out.
Re 2 - the evaluate loop runs over each possible label and the labels are then marginalized vie the logsumexp, so log_prob should be evaluated using labels as you point out.

I've corrected the code and rerun the evaluation table under the conditional mnist model -- the differences are within 2-10 nats except the maf contiional model which was lower by 50, which is surprising.