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.3.tar.gz
(3.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 simplepe-0.0.3.tar.gz.
File metadata
- Download URL: simplepe-0.0.3.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9871208258d5b54d0df4eb406cd877062ce781dfa3e4180971fcd5f7639433b5
|
|
| MD5 |
b6ccce1ecc1c7c3147f8391517929874
|
|
| BLAKE2b-256 |
60ca847ebd6101d571b7edd2c56f862cf89657b51018fb4f5e26baca742d0780
|
File details
Details for the file simplepe-0.0.3-py3-none-any.whl.
File metadata
- Download URL: simplepe-0.0.3-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 |
6def100b601e9f8f71f1a69807abd15c2f8f2d97e541762bee8991fe0a266fb8
|
|
| MD5 |
84edc8f14c41dc9c19abad8af2db5790
|
|
| BLAKE2b-256 |
edea013f7449aabcc3f20a31ddd5f2b006bf0da21fc4cab67d39447f0bbef7ea
|