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

[feat][minor] Simplicial embeddings #261

Merged
merged 2 commits into from
Apr 8, 2022
Merged

Conversation

blefaudeux
Copy link
Contributor

What does this PR do?

Follow up to #259, adds simplicial embeddings + option to add it at the bottom of an encoder. I actually don't believe that it's super important (it was kind of easy to add manually beforehand), but it does not take much space (orthogonal to the rest), and I would be curious to see how that affects things like openclip and friends.

I've done a dummy test on the ViT Cifar training, it does not meaningfully affects the score (in either way), which is not too surprising (the linear probe afterwards could already recover from "misaligned" dimensions given the strong supervised signal, which is what simplicial embeddings could improve)

Before submitting

  • Did you have fun?
    • Make sure you had fun coding 🙃
  • Did you read the contributor guideline?
  • Was this discussed/approved via a Github issue? (no need for typos, doc improvements)
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?
  • Did you update the changelog? (if needed)

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 7, 2022
adding the option in the encoder

Adding it to the microViT example
@blefaudeux blefaudeux requested review from dianaml0 and jieru-hu and removed request for dianaml0 April 7, 2022 16:20
@blefaudeux blefaudeux assigned fmassa and unassigned fmassa Apr 7, 2022
@blefaudeux blefaudeux requested a review from fmassa April 7, 2022 16:20
@blefaudeux blefaudeux linked an issue Apr 7, 2022 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Apr 7, 2022

Codecov Report

Merging #261 (a4d3cec) into main (23aaa58) will decrease coverage by 0.03%.
The diff coverage is 89.74%.

@@            Coverage Diff             @@
##             main     #261      +/-   ##
==========================================
- Coverage   92.83%   92.80%   -0.04%     
==========================================
  Files          60       61       +1     
  Lines        3324     3363      +39     
==========================================
+ Hits         3086     3121      +35     
- Misses        238      242       +4     
Flag Coverage Δ
Python 92.80% <89.74%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
xformers/components/simplicial_embedding.py 87.09% <87.09%> (ø)
xformers/factory/block_factory.py 93.30% <100.00%> (+0.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 23aaa58...a4d3cec. Read the comment docs.

Copy link
Contributor

@dianaml0 dianaml0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!! Just had one comment

xformers/components/simplicial_embedding.py Outdated Show resolved Hide resolved
@blefaudeux blefaudeux merged commit fb7bbcb into main Apr 8, 2022
@blefaudeux blefaudeux deleted the simplicial_embeddings branch April 8, 2022 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] Simplicial Embeddings
5 participants