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 to measure the embedding/representation difference between layers? #16

Closed
LifangD opened this issue Oct 9, 2019 · 2 comments
Closed

Comments

@LifangD
Copy link

LifangD commented Oct 9, 2019

Can anyone explain how to draw such figure since the L2 distance or cosine similarity is often conducted on the vector rather than the embedding matrix. Besides, how to measure it on the whole dataset?
Thanks for any suggestions or references~

image

@brightmart
Copy link
Owner

may be you can take the first position, which is [CLS] token, it represent the sequence of that layer. so that you can have a hidden states as vector to represent that specific layer.
after you trained the model, or you get a checkpoint from pre-trained model, i think you can measure it, as all the parameters are fixed. it may not relate to a downstream dataset.

@LifangD
Copy link
Author

LifangD commented Oct 11, 2019

may be you can take the first position, which is [CLS] token, it represent the sequence of that layer. so that you can have a hidden states as vector to represent that specific layer.
after you trained the model, or you get a checkpoint from pre-trained model, i think you can measure it, as all the parameters are fixed. it may not relate to a downstream dataset.

OK, thanks~

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