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

Handle logits with more than 2 axes in torch.func diag and full backends #178

Open
wiseodd opened this issue Apr 27, 2024 · 0 comments
Open
Labels
enhancement New feature or request
Milestone

Comments

@wiseodd
Copy link
Collaborator

wiseodd commented Apr 27, 2024

Currently, we still assume that logits.shape == (batch_size, n_classes). E.g.:

ps = torch.softmax(f, dim=-1)
G = torch.diag_embed(ps) - torch.einsum('mk,mc->mck', ps, ps)
return G

@wiseodd wiseodd added the enhancement New feature or request label Apr 27, 2024
@wiseodd wiseodd added this to the 0.3 milestone Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant