Skip to main content

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)

Also we incorporate RoPe embedding (for equivariance) taking inspiration from https://arxiv.org/pdf/2104.09864, https://arxiv.org/pdf/2403.13298 (2D mixed rope)

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.

Release files for dit-ml 0.2.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dit-ml 0.2.10
File Size Uploaded
dit_ml-0.2.10.tar.gz 12.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dit-ml 0.2.10
File Interpreter ABI Platform
dit_ml-0.2.10-py3-none-any.whl Python 3 none any Details

Total release size: 24.4 kB

Release files / dit_ml-0.2.10.tar.gz

Download URL dit_ml-0.2.10.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
50e3def573c24a96940094f99a7e846cbfc9062e5ec96687435e95df06951e47
BLAKE2b-256 checksum
How to use checksums
b26065e0fb5b93ae70dd626cbc270273dffd9daa58419e88212775118449fe1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release files / dit_ml-0.2.10-py3-none-any.whl

Download URL dit_ml-0.2.10-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e67dcfa6363b809c759d0cc1d87c972ec6d625725196dd3e837b532f9327078a
BLAKE2b-256 checksum
How to use checksums
112280b51b89bf8c7940afa6afc9083d818084a5c2dac43dcaa0fc089cb0ddb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release history Release notifications | RSS feed

This release

0.2.10 This release

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

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