flows_ood
flows_ood copied to clipboard
Hint on Invertibility
In case this may be helpful for someone: The iLogits class uses a constant factor, which is set in the constructor, that is applied to the input image. Thus, the pixel values of the input image that should lie between 0 and 1 move further are scaled to a lower value. When calling the inverse, this effect is not reversed, causing the output images to look fine, but the generated data is different from the training data, which makes it impossible to use this data for some purposes such as training a new model with the generated data without any further augmentation. The reason is that the inverse function in the in the iLogits class does not actually invert the forward function. From my experience, the random noise part can be ignored, but the call to the sigmoid should be supplemented by:
x = torch.sigmoid(y)
x = (2 * x - 1) / self.cnstr
return (x + 1) / 2