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

Paper "Analyzing Inverse Problems with Invertible Neural Netowrks": Error in implementation #4

Open
renatobellotti opened this issue Dec 6, 2019 · 4 comments

Comments

@renatobellotti
Copy link

Hi,

I'm trying to implement the invertible network described in the paper in Tensorflow 2.
I am having some difficulties matching the descriptions of the loss functions with the code.

Especially, I think there might be an inconsistency in this file:

If I've understood correctly, the function loss_reconstruction (that is almost undescribed in the paper) seems to use the following layout for the values that are fed to the sampling process:

Bildschirmfoto von 2019-12-06 12-24-45

However, the train_epoch function seems to use a different layout:

Bildschirmfoto von 2019-12-06 12-25-05

Is this a mistake, or does the output of the forward process really have a different format than the input of the inverse process?

@ardizzone
Copy link
Member

Hi,

thank you for raising the issue!
I am sorry to say I am on holiday the rest of the year, and I won't be able to check in more detail until January.

Until then, if in doubt, stick with the description in the paper.

@renatobellotti
Copy link
Author

renatobellotti commented Dec 9, 2019

Ok, thanks for your answer, enjoy your holidays! :)

@renatobellotti
Copy link
Author

renatobellotti commented Dec 17, 2019

I was now able to write a Tensorflow implementation of the invertible network. It can reproduce the results of the toy-8 example.

During the process of implementing this, I've discovered a few things others might benefit from when working with this paper:

  • Configuration differences compared to the paper:

    • The batch size is different than the one in the paper problem.
    • The AffineCouplingLayer uses parameter sharing: The networks for s_1 and t_1 are the same, the networks for s_2 and t_2 are also the same.
    • The AffineCouplingLayer uses clamping to avoid blow up of the exponential function.
  • Efficient implementation of MMD:

    An efficient implementation of MMD is crucial to the fast execution of this algorithm. The matrix formulation is not (at least it wasn't to me for quite some time) obvious, so perhaps a note about this might be helpful.

But apart from these suggestions: Great work, this will be valuable for lots of problems in science!

P. S.: The problem I've had in my first post is not present in the toy-8 demo notebook, but in the inverse_problems_in_science folder I've linked in my original post.

@ardizzone ardizzone transferred this issue from vislearn/FrEIA Feb 9, 2021
@krishnarld
Copy link

Hi,

I'm trying to implement the invertible network described in the paper in Tensorflow 2. I am having some difficulties matching the descriptions of the loss functions with the code.

Especially, I think there might be an inconsistency in this file:

If I've understood correctly, the function loss_reconstruction (that is almost undescribed in the paper) seems to use the following layout for the values that are fed to the sampling process:

Bildschirmfoto von 2019-12-06 12-24-45

However, the train_epoch function seems to use a different layout:

Bildschirmfoto von 2019-12-06 12-25-05

Is this a mistake, or does the output of the forward process really have a different format than the input of the inverse process?

Hi,

I have the same confusion. Have you figured it out? Please let me know. I could really use your help. Thanks.

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

3 participants