A package for Transformer blocks
Project description
Echoai Transformer Block Package
This package provides components for building Transformer blocks, including Multi-Head Attention and FeedForward layers.
Installation
You can install the package using pip:
pip install echoai-transformer-block
import torch
from echoai_transformer_block import Block
# Define parameters
n_heads = 8
n_embed = 512
block_size = 16
dropout = 0.1
expand = 4
# Create a Block instance
block = Block(n_heads, n_embed, block_size, dropout, expand)
# Example input tensor
input_tensor = torch.randn(1, 16, 512)
# Forward pass through the Block
output_tensor = block(input_tensor)
print("Output shape:", output_tensor.shape)
from echoai_transformer_block import Block
from echoai_transformer_block import MultiAttentionHead
from echoai_transformer_block import FeedForward
Requirements
Python 3.7+
PyTorch
This README file includes:
- The updated package name "Echoai Transformer Block".
- Installation instructions for the package.
- An example of how to use the `Block` class.
- Descriptions and import statements for each component (`Block`, `MultiAttentionHead`, `FeedForward`).
- Requirements section listing the required Python version and PyTorch.
- Mention of the license for the package.
You can include this updated `README.md` file in the root directory of your package alongside other files. When users visit your package's repository on GitHub or PyPI, they will see this README file, providing them with information on how to use your package.
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 echoai_transformer_block-0.1.tar.gz.
File metadata
- Download URL: echoai_transformer_block-0.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f1a4cfb09cb8aed7dfad62e43e397712982d1e8567d5e96bfa59d47fcec25a5
|
|
| MD5 |
5d2e9e9742f77012ac6166e897d28b9f
|
|
| BLAKE2b-256 |
89562a8f8dd7a6fc3eca14ae2edfe164659b49feacac1cd43719315ba18ed614
|
File details
Details for the file echoai_transformer_block-0.1-py3-none-any.whl.
File metadata
- Download URL: echoai_transformer_block-0.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
426869180259ea3c27579f8612bb4bacaebdf0b4942b0ec38d5bfea3b35774e4
|
|
| MD5 |
15c4e216b3ea5481da5f1407af80d213
|
|
| BLAKE2b-256 |
753973f0783255e28f49bf1a8c1c067f466358a08eda3c5eedce90a0891c2410
|