Skip to main content

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:

  • TransformerDecoder
  • TransformerDecoderLayer
  • TransformerEncoder
  • TransformerEncoderLayer
  • TransformerEncoderDecoder
  • FeedForwardSubLayer
  • AttentionSubLayer
  • MultiHeadAttention
  • compute_attention_matrix
  • slice_vertically
  • unslice_vertically
  • get_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)

Source distribution for transformer-components-michaelkosmider 0.1.1
File Size Uploaded
transformer_components_michaelkosmider-0.1.1.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for transformer-components-michaelkosmider 0.1.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page