lucidrains / rotary-embedding-torch

Implementation of Rotary Embeddings, from the Roformer paper, in Pytorch
MIT License
573 stars 44 forks source link

Does this library support 2D RoPE embeddings? #13

Closed logicchains closed 1 year ago

logicchains commented 1 year ago

The original RoPE paper suggests it can easily be extended to a 2D embedding (with two embedding dimensions rather than just one), does this library support that? If not, would it be difficult to add?

lucidrains commented 1 year ago

@logicchains yes it does, it is in the readme, under axial rotary embeddings

lucidrains commented 1 year ago

i also have an example here https://github.com/lucidrains/vit-pytorch/blob/main/vit_pytorch/rvt.py validated to converge well by some researchers on Eleuther