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

How can one un-BERTify when last_four_layers_embedding = True? #1

Open
yu202147657 opened this issue Feb 27, 2023 · 0 comments
Open

Comments

@yu202147657
Copy link

These two lines are added when last_four_layers_embedding=True:

# cast layers to a tuple and concatenate over the last dimension
cat_hidden_states = torch.cat(tuple(last_four_layers), dim=-1)

# take the mean of the concatenated embedding vectors over the token dimension
text_embedding = torch.mean(cat_hidden_states, dim=1)  

However, once you take the mean, how would you recover the original text from the embeddings produced?

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

1 participant