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

A question about a priori computation in X-Net.py #18

Closed
LanJ0402 opened this issue Mar 29, 2024 · 2 comments
Closed

A question about a priori computation in X-Net.py #18

LanJ0402 opened this issue Mar 29, 2024 · 2 comments

Comments

@LanJ0402
Copy link

LanJ0402 commented Mar 29, 2024

Hello author, thank you very much for open-sourcing the code for the TGRS paper, I've encountered some problems in reproducing your work, you mentioned in your paper that the prior is obtained by calculating and then averaging over three different scales, but is the implementation strategy in your actual code inconsistent with the instructions in your paper?
For example, you are using three images in your code that are zoomed in 2x, the original image, and zoomed out 2x to calculate the prior at a patch_size of 20, but that's what you wrote in your paper
image

I'd like to ask which of these two strategies works better in your work?
Looking forward to your reply very much!

@llu025
Copy link
Owner

llu025 commented Apr 2, 2024

Hello,

Although the paper was published in 2021, the code used to produce the initial results was much older than that and was written in TF version 1.14. In that legacy code (found here), the prior was computed using zoomed in, normal, and zoomed out images.

In an effort to translate to TF version 2.4, the prior calculation was rewritten (see here). In this new version the prior are calculated as stated in the paper.

HOWEVER, I just now realise that the function in the new version of the code does not seem to work the way I intended it. In fact, I realised that the logic inside the for loop (and especially the logic behind the if i < 0 statement) seems to be flawed. Unfortunately, I do not have the time to fix it at the moment, so I will have to leave the issue open for now.

In any case, if the legacy method works for you, please use that one. I do not expect results to differ much between zooming in and out the images or doubling and halving the value of k (except for larger computational load).

@LanJ0402
Copy link
Author

LanJ0402 commented Apr 2, 2024

OK, I get it, thank you for your reply!

@LanJ0402 LanJ0402 closed this as completed Apr 2, 2024
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

2 participants