transformer_components_michaelkosmider
This package contains the source code for the Transformer implementation featured in my tutorial:
🔗 Transformer Tutorial
The full source code for this package is available here:
GitHub – transformer_components_michaelkosmider
Installation
This package requires PyTorch but does not install it automatically. You must install the correct version for your system (CPU/GPU, CUDA version, etc.) first:
PyTorch Installation Instructions
Once PyTorch is installed, install this package from PyPI.
Available Imports
This package exposes the following classes and functions at the top level:
TransformerDecoderTransformerDecoderLayerTransformerEncoderTransformerEncoderLayerTransformerEncoderDecoderFeedForwardSubLayerAttentionSubLayerMultiHeadAttentioncompute_attention_matrixslice_verticallyunslice_verticallyget_causal_mask
Example:
from transformer_components_michaelkosmider import TransformerEncoder, get_causal_mask
encoder = TransformerEncoder(...)
mask = get_causal_mask(seq_len=10)
Metadata
Release files for transformer-components-michaelkosmider 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 | |
|---|---|---|---|
| transformer_components_michaelkosmider-0.1.1.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| transformer_components_michaelkosmider-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.5 kB
Release files / transformer_components_michaelkosmider-0.1.1.tar.gz
| Download URL | transformer_components_michaelkosmider-0.1.1.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbc7fa5faca719c1c29b9f2d84507b82674f8b96b08279ba4603ab85f1147367
|
|
BLAKE2b-256 checksum How to use checksums |
a0c69644d051a09248ed9c335db748c8a59e20187766545352ee842e2aa153ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Release files / transformer_components_michaelkosmider-0.1.1-py3-none-any.whl
| Download URL | transformer_components_michaelkosmider-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e88fa8ce363837b9656ca60ffeb4be54e6d48763f502dc74cef22948f12177b
|
|
BLAKE2b-256 checksum How to use checksums |
47b23935257938862484b79379ad7e50aff8e4dc57824c6dd3e2f36712e30810
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|