Skip to main content

Discrete Distribution Network

Project description

Discrete Distribution Network (wip)

Exploration into Discrete Distribution Network, by Lei Yang out of Beijing

Besides the split-and-prune, may also throw in an option for crossover (mixing of top 2 nodes to replace the pruned)

Install

$ discrete-distribution-network

Usage

import torch
from discrete_distribution_network.ddn import DDN

ddn = DDN(
    dim = 32,
    image_size = 256
)

images = torch.randn(2, 3, 256, 256)

loss = ddn(images)
loss.backward()

# after much training

sampled = ddn.sample(batch_size = 1)

assert sampled.shape == (1, 3, 256, 256)

Oxford flowers

Install uv, which will probably become the default in the near future

$ pip install uv

Then

$ uv run train_oxford_flowers.py

Citations

@misc{yang2025discretedistributionnetworks,
    title   = {Discrete Distribution Networks}, 
    author  = {Lei Yang},
    year    = {2025},
    eprint  = {2401.00036},
    archivePrefix = {arXiv},
    primaryClass = {cs.CV},
    url     = {https://arxiv.org/abs/2401.00036}, 
}

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

discrete_distribution_network-0.1.5.tar.gz (675.8 kB view details)

Uploaded Source

Built Distribution

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

discrete_distribution_network-0.1.5-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file discrete_distribution_network-0.1.5.tar.gz.

File metadata

File hashes

Hashes for discrete_distribution_network-0.1.5.tar.gz
Algorithm Hash digest
SHA256 4ee23d1643b111b3dc4f1922440f5c9692fdc3d7a84671cfc9b6a7324635e177
MD5 9eba892ced139d41a7a9f41fc5abcdc7
BLAKE2b-256 9d5448e1a0aba5215469e1168c24222fd418a5c7f2f989656aca596dbde031d4

See more details on using hashes here.

File details

Details for the file discrete_distribution_network-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for discrete_distribution_network-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1e6c58b0912df1ad28b6c24fb91241820a67477a3ef80f82a34218b590a69978
MD5 a9b23882e9fe9e8950f828f0fc592d5b
BLAKE2b-256 a9c53af293e97011f897b5796da8812e85d9de626603ca5f38ce2e7517462680

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