A simple simplepe for positional encoding
Project description
SimplePE
Simple implementation of some Positional Encoding methods in PyTorch.
- Sinusoidal Positional Encoding
- Rotary Positional Encoding
Installation
git clone https://github.com/donglinkang2021/simplepe.git
cd simplepe
pip install .
Usage
python example.py # pe value
python example2.py # attention score
You can see the following results:
| Method | Sinusoidal | Rotary |
|---|---|---|
| Dimension-Time_Step Heatmap | ||
| Value-Time_Step Line_Plot | ||
| Multi-Head Dimension-Time_Step Heatmap | ||
| Multi-Head Value-Time_Step Line_Plot |
| Method\Time_Step-Time_Step Heatmap | T=2048, D=32 | T=2048, D=64 | T=4096, D=512 |
|---|---|---|---|
| Sinusoidal | |||
| Rotary |
| Method\Attention_Score-Time_Step Line_Plot | T=2048, D=32 | T=2048, D=64 | T=4096, D=512 |
|---|---|---|---|
| Sinusoidal | |||
| Rotary |
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
simplepe-0.0.2.tar.gz
(3.8 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 simplepe-0.0.2.tar.gz.
File metadata
- Download URL: simplepe-0.0.2.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8afcb255a6efb250cafc815a4b27154c2615656f696f47f34224525fffb46470
|
|
| MD5 |
79b5667e79528036781cc41c1e17c3d6
|
|
| BLAKE2b-256 |
30d2d0330443b0eb11640b46e22ee42398b8f734a286f6a79b3d986c7db15fa9
|
File details
Details for the file simplepe-0.0.2-py3-none-any.whl.
File metadata
- Download URL: simplepe-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce3431d2d992f0dbbdccec67106c4fecc8f6633227b199425969c0f2dae0fb88
|
|
| MD5 |
330eabafd5b02a309dd7fc641f4260de
|
|
| BLAKE2b-256 |
aaa8d48e62d649cb6f8da928bfd6c1d5b9b6f98a5bf6cc70e86fb3b4586818f5
|