einorm
An einops-style generalized normalization layer.
Installation
You need torch >= 1.13 or functorch to be installed:
pip install einorm
Usage
from einorm import Einorm
# Equivalent to nn.LayerNorm(1024)
Einorm("b n d", "d", d=1024)
# Specify the dimensions and sizes to normalize along.
Einorm("a b c d e", "b d", b=3, d=4)
According to ViT-22B, normalizing query and key in a head-wise fashion can help stabilize the training dynamics. This can be achieved by providing additional grouping arguments to Einorm:
Einorm("b h n d", "d", "h", h=16, d=64) # num_heads=16, head_dim=64
Metadata
Release files for einorm 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| einorm-0.1.1.tar.gz | 3.8 kB | Without provenance | Details for einorm-0.1.1.tar.gz |
Release files / einorm-0.1.1.tar.gz
| Download URL | einorm-0.1.1.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4302da9479607ae528747ded9bf29c6935ffdee77b3b7f7bec673a6983f1655b
|
|
BLAKE2b-256 checksum How to use checksums |
9ffd3c290a6a11c64ce0f44a61fa6f00f1f0714242320908e6716e948af3aa1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.9.16 Linux/5.15.0-1033-azure
|
Security for einorm 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.