chaiyujin / glow-pytorch

pytorch implementation of openai paper "Glow: Generative Flow with Invertible 1×1 Convolutions"
MIT License
507 stars 80 forks source link

Invertibility of Glow #9

Closed makedede closed 5 years ago

makedede commented 5 years ago

Hi Yujin,

Thanks for the nice implementation. From your reconstruction demo, it seems that the implementation cannot guarantee full invertibility of glow. Could you comment on it?

Best,

Kede

chaiyujin commented 5 years ago

Hi, @makedede . I want to figure out what do you mean with invertibility.

makedede commented 5 years ago

Then I understand that you only make use of the coarsest scale of z for reconstruction and the blurry images make sense to me.

plutoyuxie commented 5 years ago

Hi, @chaiyujin,

Thanks for the reimplement of glow in pytorch. I think it is not bad to keep the same dimensions of Z as the input image. Reducing dimensions results in information loss. Your code is very helpful, thanks again, anyway.

chaiyujin commented 5 years ago

@plutoyuxie Thanks for your attention. What do you mean about "keep the same dimensions of Z as the input image"? If the input image is (3, H, W), what the shape of Z in your case?

plutoyuxie commented 5 years ago

Hi, @chaiyujin,

Thanks for your response. In your case, the input image shape is (3, 64, 64) and L = 3. The total dimensions of z should be equal to 3X64X64=12,288. After discarding the first part of z (6, 32, 32) and the second part of z (12, 16, 16), only 1/4 dimensions of z (48, 8, 8) left. That leads to bad reconstruction result because of some information loss. I think it is kind of limitation for flow-based models. The large dimensions of z seem to be wasteful but necessary.