Skip to main content

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 Sinusoidal Rotary
Value-Time_Step Line_Plot Sinusoidal Rotary
Multi-Head Dimension-Time_Step Heatmap Sinusoidal Rotary
Multi-Head Value-Time_Step Line_Plot Sinusoidal Rotary
Method\Time_Step-Time_Step Heatmap T=2048, D=32 T=2048, D=64 T=4096, D=512
Sinusoidal Sinusoidal Sinusoidal Sinusoidal
Rotary Rotary Rotary Rotary
Method\Attention_Score-Time_Step Line_Plot T=2048, D=32 T=2048, D=64 T=4096, D=512
Sinusoidal Sinusoidal Sinusoidal Sinusoidal
Rotary Rotary Rotary Rotary

Project details


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simplepe-0.0.3-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

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

Hashes for simplepe-0.0.3.tar.gz
Algorithm Hash digest
SHA256 9871208258d5b54d0df4eb406cd877062ce781dfa3e4180971fcd5f7639433b5
MD5 b6ccce1ecc1c7c3147f8391517929874
BLAKE2b-256 60ca847ebd6101d571b7edd2c56f862cf89657b51018fb4f5e26baca742d0780

See more details on using hashes here.

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

Hashes for simplepe-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6def100b601e9f8f71f1a69807abd15c2f8f2d97e541762bee8991fe0a266fb8
MD5 84edc8f14c41dc9c19abad8af2db5790
BLAKE2b-256 edea013f7449aabcc3f20a31ddd5f2b006bf0da21fc4cab67d39447f0bbef7ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page