Closed arogozhnikov closed 5 years ago
Thanks so much for you recommendations. I'll follow them and fix the code.
The slogdet function returns a tuple of sign and absolute value of determinant. https://pytorch.org/docs/stable/torch.html#torch.slogdet I think you need to modify to get the value like below
torch.slogdet(self.weight)[1] * pixels
oooh, my fault. It should be torch.logdet().
oooh, my fault. It should be torch.logdet().
@wmjung is right - you just need to take second value in output, because in paper you compute log-abs-det, that's exactly the second value of slogdet!
Yes, you're right. I tried and fixed it.
I've performed some tests for reversible modules, I think the following recommendations should be helpful:
torch.inverse(x.double()).float()
, this significantly reduces reconstruction errortorch.slogdet
method, which more accurate then manual log+abs+det:dlogdet = torch.log(torch.abs(torch.det(self.weight))) * pixels
Thanks for porting code to torch :)