Reusable Transformer model components.
Project description
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)
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
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 transformer_components_michaelkosmider-0.1.1.tar.gz.
File metadata
- Download URL: transformer_components_michaelkosmider-0.1.1.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbc7fa5faca719c1c29b9f2d84507b82674f8b96b08279ba4603ab85f1147367
|
|
| MD5 |
43b1927fca4773bf382c7a3b56f76d85
|
|
| BLAKE2b-256 |
a0c69644d051a09248ed9c335db748c8a59e20187766545352ee842e2aa153ff
|
File details
Details for the file transformer_components_michaelkosmider-0.1.1-py3-none-any.whl.
File metadata
- Download URL: transformer_components_michaelkosmider-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e88fa8ce363837b9656ca60ffeb4be54e6d48763f502dc74cef22948f12177b
|
|
| MD5 |
81dcb03c90d25f162ace13176e1eb72f
|
|
| BLAKE2b-256 |
47b23935257938862484b79379ad7e50aff8e4dc57824c6dd3e2f36712e30810
|