PoPE
Project description
PoPE-pytorch
Efficient implementation (and explorations) into polar coordinate positional embedding (PoPE) - from Gopalakrishnan et al. under Schmidhuber
Install
$ pip install PoPE-pytorch
Usage
import torch
from PoPE_pytorch import PoPE
# define pope
pope = PoPE(64, heads = 8)
# pass in sequence length
pos_embed = pope(1024)
# queries and keys in attention
q = torch.randn(1, 8, 1024, 64)
k = torch.randn(1, 8, 1024, 64)
# training
rotated_q, rotated_k = pope.apply_pope_to_qk(pos_embed, q, k)
# inference
rotated_q, rotated_k = pope.apply_pope_to_qk(pos_embed, q[..., -1:, :], k)
Citations
@misc{gopalakrishnan2025decouplingwhatwherepolar,
title = {Decoupling the "What" and "Where" With Polar Coordinate Positional Embeddings},
author = {Anand Gopalakrishnan and Robert Csordás and Jürgen Schmidhuber and Michael C. Mozer},
year = {2025},
eprint = {2509.10534},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2509.10534},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pope_pytorch-0.0.1.tar.gz
(203.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pope_pytorch-0.0.1.tar.gz.
File metadata
- Download URL: pope_pytorch-0.0.1.tar.gz
- Upload date:
- Size: 203.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe258618a7f507e3d255a8bae1bceade5105e3a64adc4ca5764af3bd8b52970f
|
|
| MD5 |
f541fa639edfb4ac4303e9d408231743
|
|
| BLAKE2b-256 |
0c346a417d98aa3bc93c4a1f3d49084b258cab0fb29de297f8cfaa84cb155a40
|
File details
Details for the file pope_pytorch-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pope_pytorch-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2b51dd0252e9853c8d53fbb71e6ce05136f5cbc153c40e286527408dd276939
|
|
| MD5 |
e15e6d6124aeec10b491aebb067db62e
|
|
| BLAKE2b-256 |
b8091e1b1378b849e1fa75cffe40bbd7137dcc04031f1209c7867c8c9aa1d6cf
|