pytorch-normalizing-flows icon indicating copy to clipboard operation
pytorch-normalizing-flows copied to clipboard

Fixed bug with invertibility of AffineHalfFlow

Open TrentBrick opened this issue 6 years ago • 2 comments

I realized that the concatenation operation for the AffineHalfFlow is not correct given the even odd masking that occurs. I have implemented a simple fix for this.

TrentBrick avatar Jan 27 '20 18:01 TrentBrick

Or you could do x0, x1 = x.chunk(2, dim=1) and leave z = torch.cat([z0, z1], dim=1) as is. See the note on cats inverse operation here.

janosh avatar Feb 09 '20 18:02 janosh

I realized that the concatenation operation for the AffineHalfFlow is not correct given the even odd masking that occurs. I have implemented a simple fix for this.

Can we treat this even odd thing as a permutation matrix operation to the original input vector x, and the |log_det| of this operation is 0, then this would not be a bug here (For my own problem, I found the result of this is better than simply: x0, x1 = x.chunk(2, dim = 1) and then using z = torch.cat([z0, z1], dim = 1). Any other got the similar result here?

XuebinZhaoZXB avatar Jul 01 '20 12:07 XuebinZhaoZXB