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

Potential errors in the Glow model's implementation #1

Open
a-little-hoof opened this issue Nov 3, 2024 · 0 comments
Open

Potential errors in the Glow model's implementation #1

a-little-hoof opened this issue Nov 3, 2024 · 0 comments

Comments

@a-little-hoof
Copy link

Thank you so much for sharing the source code!

While running the code, I noticed a possible issue in the implementation of the Glow model. In model_tools.py, within the InvBlock class, it seems that the Jacobian calculation might be incorrect. Specifically, in the forward and reverse functions of class InvBlock, where the multi-scale architecture is applied, it appears the Jacobian term was unintentionally omitted after splitting the input and feeding it into the prior network. To address this, after line 987 and line 1027, consider updating the Jacobian calculation as follows: logdet = logdet + log_sd.view(b_size, -1).sum(1).

Additionally, I found that modifying the sigmoid function to tanh in the AffineCoupling class can improve the model's performance. Adding gradient clipping helps stabilize training. I've shared my own implementation of the Glow model here for reference: https://github.com/a-little-hoof/Glow.

I hope these suggestions are helpful for your research. Thanks again, and have a great day!

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