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

Add projection operation #36

Open
adamkarvonen opened this issue Mar 20, 2024 · 1 comment
Open

Add projection operation #36

adamkarvonen opened this issue Mar 20, 2024 · 1 comment

Comments

@adamkarvonen
Copy link

adamkarvonen commented Mar 20, 2024

I have been experimenting with the linear, piece-wise, and projection operations for representation control. It would be useful to have the projection operation available for reference to make sure my implementation matches what was used in the paper. But, it's currently not implemented.

elif operator == 'projection':
def op(current, controller):
raise NotImplementedError

@andyzoujm
Copy link
Owner

I think something like
return current - (current * controller).sum(-1, keepdim=True) * controller / controller.norm(-1, keepdim=True)

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