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.6.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

mmm_zeta-0.0.6-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mmm_zeta-0.0.6.tar.gz
  • Upload date:
  • Size: 5.2 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.6.tar.gz
Algorithm Hash digest
SHA256 5fa00e4629689cd7810a65b97ced6e7ce77439c1880a6d1a4567284f550a6462
MD5 e046ac9a6ccf750822e8a93a87627ef8
BLAKE2b-256 502eb0bdc7ff264fdbf17212783819c00dc28d55294adc1ebda46f88244d4066

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mmm_zeta-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 5.6 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e668f90d174b06c96132562d4294130faf06f0d11be015bdfd8bbd001f19359e
MD5 8d986190706d1506bfa613e1a18d6910
BLAKE2b-256 2469684a9a5833b72bafd2a51a3e3f924cb1bed91e844943ced6aee6a2c6bc75

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