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

2D Matryoshka Sentence Embeddings #71

Open
vasilisvyth opened this issue Apr 14, 2024 · 3 comments
Open

2D Matryoshka Sentence Embeddings #71

vasilisvyth opened this issue Apr 14, 2024 · 3 comments

Comments

@vasilisvyth
Copy link

Thanks for your great work. Could you please provide the code for 2D Matryoshka Sentence Embeddings or any checkpoints?

@SeanLee97
Copy link
Owner

Hi @vasilisvyth, we are still working on improving it. The code for the improved version will be released soon.

For checkpoints, you can try bellows:

@dribnet
Copy link

dribnet commented May 18, 2024

Thanks - the 2dmse-bert-base-nli model loads and perform well for me using the full hidden size, which appears to be 768.

Can you confirm that the other usable hidden sizes on this model would be n={8, 16, 32, 64, 128, 256, 512} taken by clipping the full vector from v[0:n]?

@SeanLee97
Copy link
Owner

Update:

Hi @dribnet @vasilisvyth, I updated angle_emb to version 0.4.0 today. It's now much easier to use for inferring multiple types of sentence embeddings.

For Espresso (previously 2DMSE) or Matryoshka embeddings, you can find usage here: https://angle.readthedocs.io/en/latest/notes/quickstart.html#infer-espresso-matryoshka-models.


For @dribnet 's question:

Can you confirm that the other usable hidden sizes on this model would be n={8, 16, 32, 64, 128, 256, 512} taken by clipping the full vector from v[0:n]?

Answer:
You can use any embedding size for Espresso or Matryoshka embeddings as long as it is below the maximum embedding size.

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