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

Spectral Positional Encoding #45

Closed
BrianPugh opened this issue Nov 10, 2021 · 6 comments
Closed

Spectral Positional Encoding #45

BrianPugh opened this issue Nov 10, 2021 · 6 comments

Comments

@BrianPugh
Copy link

I see in your FourierUnit you added an optional spectral_pos_encoding argument. Have you experimented at all with this? Has it improved/reduced performance?

@windj007
Copy link
Collaborator

Wow! Great that you've noticed that :)

We experimented with positional encoding in spectral domain just a little bit. It did not help for the inpainting on our benchmarks - but might work in other cases. But we did not explore that feature thoroughly enough to say something for sure.

I'll be happy to hear back if this feature helps :)

@BrianPugh
Copy link
Author

Interesting, I would expect positional encoding (possibly a different encoding than a simple linear mesh) would have helped.

So, this suggests a few possible outcomes (1x1 filter/conv here will always refer to the conv in the frequency domain inside the Spectral Transform block):

  1. The 1x1 filter doesn't take frequency into account/is frequency agnostic (this also applies to the original FFC paper).
  2. Some sort of spatial information is latently encoded in the featuremaps. In this case, the 1x1 convolution takes frequency into account, but the positional encoding is redundant.
  3. The frequency/phase domain isn't really important; each pixel in the spectral image is to just be interpreted as a different hash of the entire input featuremap.
  4. The 1x1 filter doesn't actually do anything. Perhaps the real power just comes from applying BN and relu on the spectral image before applying the iFFT. Or, perhaps its inappropriate to perform the BN/relu since it limits what the post-iFFT transform image looks like.

@Marcelo5444
Copy link

Hi @BrianPugh, Have you done any further research on that?

@BrianPugh
Copy link
Author

i have not had a chance/the resources to perform experiments with these changes.

@Mengmengbai
Copy link

Interesting, I would expect positional encoding (possibly a different encoding than a simple linear mesh) would have helped.

So, this suggests a few possible outcomes (1x1 filter/conv here will always refer to the conv in the frequency domain inside the Spectral Transform block):

  1. The 1x1 filter doesn't take frequency into account/is frequency agnostic (this also applies to the original FFC paper).
  2. Some sort of spatial information is latently encoded in the featuremaps. In this case, the 1x1 convolution takes frequency into account, but the positional encoding is redundant.
  3. The frequency/phase domain isn't really important; each pixel in the spectral image is to just be interpreted as a different hash of the entire input featuremap.
  4. The 1x1 filter doesn't actually do anything. Perhaps the real power just comes from applying BN and relu on the spectral image before applying the iFFT. Or, perhaps its inappropriate to perform the BN/relu since it limits what the post-iFFT transform image looks like.

Great idea!I agree with you. Maybe I can do some experiments.

@Ellohiye
Copy link

Interesting, I would expect positional encoding (possibly a different encoding than a simple linear mesh) would have helped.
So, this suggests a few possible outcomes (1x1 filter/conv here will always refer to the conv in the frequency domain inside the Spectral Transform block):

  1. The 1x1 filter doesn't take frequency into account/is frequency agnostic (this also applies to the original FFC paper).
  2. Some sort of spatial information is latently encoded in the featuremaps. In this case, the 1x1 convolution takes frequency into account, but the positional encoding is redundant.
  3. The frequency/phase domain isn't really important; each pixel in the spectral image is to just be interpreted as a different hash of the entire input featuremap.
  4. The 1x1 filter doesn't actually do anything. Perhaps the real power just comes from applying BN and relu on the spectral image before applying the iFFT. Or, perhaps its inappropriate to perform the BN/relu since it limits what the post-iFFT transform image looks like.

Great idea!I agree with you. Maybe I can do some experiments.

Hi, have you done an experiment? What was the result?

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

6 participants