Skip to main content

MMM - Pytorch

Project description

Multi-Modality

Multi Modal Mamba - [MMM]

A novel implementation of fusing ViT with Mamba into a fast, agile, and high performance Multi-Modal Model. Powered by Zeta, the simplest AI framework ever.

Install

pip3 install mmm-zeta

Usage

# Import the necessary libraries
import torch 
from torch import nn
from mm_mamba import MultiModalMambaBlock

# Create some random input tensors
x = torch.randn(1, 16, 64)  # Tensor with shape (batch_size, sequence_length, feature_dim)
y = torch.randn(1, 3, 64, 64)  # Tensor with shape (batch_size, num_channels, image_height, image_width)

# Create an instance of the MultiModalMambaBlock model
model = MultiModalMambaBlock(
    dim = 64,  # Dimension of the token embeddings
    depth = 5,  # Number of transformer layers
    dropout = 0.1,  # Dropout probability
    heads = 4,  # Number of attention heads
    d_state = 16,  # Dimension of the state embeddings
    image_size = 64,  # Size of the input image
    patch_size = 16,  # Size of each image patch
    encoder_dim = 64,  # Dimension of the encoder token embeddings
    encoder_depth = 5,  # Number of encoder transformer layers
    encoder_heads = 4  # Number of encoder attention heads
)

# Pass the input tensors through the model
out = model(x, y)

# Print the shape of the output tensor
print(out.shape)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mmm_zeta-0.0.3.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

mmm_zeta-0.0.3-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file mmm_zeta-0.0.3.tar.gz.

File metadata

  • Download URL: mmm_zeta-0.0.3.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0

File hashes

Hashes for mmm_zeta-0.0.3.tar.gz
Algorithm Hash digest
SHA256 6927c89846a8dfa50c8228cf89e408868da9b3bc56d59334a1a995c1c9b2ff19
MD5 0d66158175075c1299433d3e14510181
BLAKE2b-256 dfd2e2112e8c4f2f123bcea154b2c0b217c6fe1462c815e2d4f33de3a6bc365e

See more details on using hashes here.

File details

Details for the file mmm_zeta-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: mmm_zeta-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0

File hashes

Hashes for mmm_zeta-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f099cda5592a815c039c43ba2a45786f8fb58bfeb43ab4d40aa7c33f9277d172
MD5 1295bb84fa9dcfb01b119bc793aebf40
BLAKE2b-256 95df3b71501b8c8dd6ba760e2657560e0e44820f432d03a3ea984286cb94d9cd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page