Skip to main content

DiT (Diffusion Transformer)

Project description

PyPI - Version CI

dit_ml

The goal of dit_ml is to create a python repository to create the base model for diffusion transformer (https://arxiv.org/abs/2212.09748)

Installation

You can install dit_ml using pip:

pip install dit_ml

Usage

Here's a basic example of how to use dit_ml:

from dit_ml.dit import DiT

model = DiT(
    num_patches=input_size*input_size, # if 2d with flatten size
    hidden_size=hidden_size,
    depth=depth,
    num_heads=num_heads,
    learn_sigma=learn_sigma
)

dummy_x = torch.randn(batch_size, input_size * input_size, hidden_size)

dummy_c = torch.randn(batch_size, hidden_size) # Dummy conditioning vector

output = model(dummy_x, dummy_c) # of shape (batch_size, input_size * input_size, hidden_size)

Development

To set up the development environment:

  1. Clone the repository:
git clone https://github.com/Forbu/dit_ml.git
cd dit_ml
  1. Install dependencies using uv:
uv sync
  1. Run tests:
uv run pytest

Contributing

Contributions are welcome! Please see the LICENSE for details.

License

This project is licensed under the Apache 2.0 - see the LICENSE file for details.

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

dit_ml-0.2.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dit_ml-0.2.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file dit_ml-0.2.1.tar.gz.

File metadata

  • Download URL: dit_ml-0.2.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.12

File hashes

Hashes for dit_ml-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2519fbef7a5933b03048c84f1e855d2ca78347e9e54f3e53dab8abbe28e6c2dc
MD5 a0a1662ca2eb2dc007c94489e7c683f7
BLAKE2b-256 f36abe17688bf7fa83237c80d592ee7cb40dd305b419e2dfc4952e14fefb99dd

See more details on using hashes here.

File details

Details for the file dit_ml-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: dit_ml-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.12

File hashes

Hashes for dit_ml-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d3c7d413475e61fc15fcbc81f96a2fda366fcb8cd34dcea8e6531b9070a6ebf
MD5 4659ee1bbb902894697900d7467cdc00
BLAKE2b-256 7eafdd96e63ce0ff2684a0e4ffa83ab3a662a1039fc850dde74baabac964e03a

See more details on using hashes here.

Supported by

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