karpathy / karpathy/pytorch-normalizing-flows

Potential bug detected for high-dimension real NVP

Open
#5 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
919
Forks
102
PR merge metrics
No merged PRs in 30d

Description

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:

https://github.com/karpathy/pytorch-normalizing-flows/blob/b60e119b37be10ce2930ef9fa17e58686aaf2b3d/nflib/flows.py#L108

https://github.com/karpathy/pytorch-normalizing-flows/blob/b60e119b37be10ce2930ef9fa17e58686aaf2b3d/nflib/flows.py#L122

They should be:

x0, x1 = x[:, :self.half_dim], x[:, self.half_dim:]
z0, z1 = z[:, :self.half_dim], z[:, self.half_dim:]

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.