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.2.tar.gz (675.6 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.2-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for discrete_distribution_network-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9387e25eed14272929f041700e2cc67f04b1725310b6278d9f29a6bd269e64aa
MD5 0cd7757096dec74ae3848c8bb8fa23a5
BLAKE2b-256 28ec4d1d51fbe15264f94fd4320ec5d4347c6c403a605f38eca5280b34fffadf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for discrete_distribution_network-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 06cd4b0dc948daa026b482eb8c8e6455638fa42961637f8e383c55695c99172b
MD5 5020404d712d021df1c162bafb156831
BLAKE2b-256 742ea078d0f04db5e5c34b3bfaf382d6b0853756631fb4280e7b41fbbd4c5912

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