I found the backflow of real NVP cannot reconstruct the original input data. This is caused by a bug in code when the dimension is more than 2:
|
x0, x1 = x[:,::2], x[:,1::2] |
|
z0, z1 = z[:,::2], z[:,1::2] |
They should be:
x0, x1 = x[:, :self.half_dim], x[:, self.half_dim:]
z0, z1 = z[:, :self.half_dim], z[:, self.half_dim:]
I found the backflow of real NVP cannot reconstruct the original input data. This is caused by a bug in code when the dimension is more than 2:
pytorch-normalizing-flows/nflib/flows.py
Line 108 in b60e119
pytorch-normalizing-flows/nflib/flows.py
Line 122 in b60e119
They should be:
x0, x1 = x[:, :self.half_dim], x[:, self.half_dim:]
z0, z1 = z[:, :self.half_dim], z[:, self.half_dim:]