Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An important bug in flow.py #10

Open
zhengqigao opened this issue Apr 27, 2023 · 0 comments
Open

An important bug in flow.py #10

zhengqigao opened this issue Apr 27, 2023 · 0 comments

Comments

@zhengqigao
Copy link

Take the forward function in the Affineflow class as an example. x0 is constructed by x[0], x[2], x[4],..., and x1 is constructed by x[1], x[3], x[5], ..... But z is obtained by directly concatenating z0 and z1 side by side: z = [z0[0], z0[1], ...., z0[N], z1[0], z1[1], ... z1[N]]. But the correct way should be: z = [z0[0], z1[0], z0[1], z1[1], z0[2], z1[2], ....z0[N], z1[N]].

The code currently has inconsistent output when calling forward and then backward.

x =torch.rand(10,4)
z, log_det = net(x) # here net is an Affineflow
x0, log_det2 = net(z)
# x0 and x will be different
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant