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

Concept Manipulation #3

Open
lindapu-1 opened this issue Oct 23, 2023 · 1 comment
Open

Concept Manipulation #3

lindapu-1 opened this issue Oct 23, 2023 · 1 comment

Comments

@lindapu-1
Copy link

Hi Hila! Thanks for your fantastic work.

I found the concept manipulation example to be incredibly intriguing, especially when it comes to dual-meaning concepts like "crane."

I'm curious about how you adjust the weight of "stork" in the showcased example to illustrate different degrees of the concept. Is it simply a matter of manipulating the weight of "stork" in the embedding? Additionally, I'm wondering if there is any code available that allows us to experiment with this concept manipulation.

Thank you!

@hila-chefer
Copy link
Owner

Hi @lindapu-1, thanks for your interest and your kind words!

Our code is available under the Google research repo so you should be able to reproduce our results by following the instructions there :)
As for the manipulation- after obtaining the decomposition, you can see an example of performing inference with the learned decomposition in this notebook. The Visualize top coefficients and top tokens cell allows you to print the top 10 decomposition elements and their learned coefficients. You can then manipulate the coefficients (in sorted_alphas). For the "stork" example, I recommend trying to zero out the coefficient to see its impact, and trying to multiply it by a factor of 2 to see the stork element in the original image.

I hope this helps!

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