equinox icon indicating copy to clipboard operation
equinox copied to clipboard

Feature Request: add attention utility functions like flax

Open jenkspt opened this issue 1 year ago • 3 comments

It would be nice to split up the the MultiheadAttention Module code into utility functions for calculating attention weights and multihead attention without projection layers. Flax does this -- but would be nice to have it here as well.

https://github.com/google/flax/blob/main/flax/linen/attention.py#L40-L187

jenkspt avatar Jul 21 '22 19:07 jenkspt

Sounds reasonable. I'd be happy to accept a PR doing this.

patrick-kidger avatar Jul 21 '22 19:07 patrick-kidger

Hey, I'd be interested in picking this up as a first issue if that's alright!

anshradh avatar Jul 27 '22 04:07 anshradh

Go for it!

patrick-kidger avatar Jul 27 '22 07:07 patrick-kidger