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 compute feature map variances? #6

Closed
LostXine opened this issue Mar 8, 2022 · 4 comments
Closed

how to compute feature map variances? #6

LostXine opened this issue Mar 8, 2022 · 4 comments

Comments

@LostXine
Copy link

LostXine commented Mar 8, 2022

hello,

Thank you for your great work!

I wonder how you get the feature map variances. According to my understanding, you first need to extract representations of all the samples, which should give us a vector with a length of D (let's just fatten the 2d tensor or concatenate all tokens). Then you calculate the variance of each element in this vector over all the samples, which should give us D variances. Finally, you take the mean value of all D variances and get the variance ready to report.

Did I get you correctly? Sorry if I didn't catch up with your existing documentation or description.

Thank you and I'm looking forward to your reply.

Best,

@xxxnell
Copy link
Owner

xxxnell commented Mar 8, 2022

Hi, thank you for your support!

Yes, you explained correctly. I calculated the variance of the tokens per channel and then averaged them.

I will release the code after re-implementing it. I can't give a definite timeline, but I’ll try hard to release the whole code for the feature map variance by this Friday!

@LostXine
Copy link
Author

LostXine commented Mar 9, 2022

Thanks for the prompt response! Have a nice day

@LostXine LostXine closed this as completed Mar 9, 2022
@xxxnell
Copy link
Owner

xxxnell commented Mar 20, 2022

I just released featuremap_variance.ipynb (Colab notebook). I'm sorry for the late release.

@LostXine
Copy link
Author

Thank you so much!

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