Skip to main content

A small PyTorch library for Mixture Density Networks.

Project description

🎨 Mixture-Density-Nets

A small PyTorch library for Mixture Density Networks.

Install

simply run pip install mixture-density-nets

Example

from mixture_density_nets import MDN, MDDistribution
# ....
mdn = MDN(in_dim, out_dim, n_components)
# ....
mu, sigma, lambda_ = mdn(net(input_data))
dist = MDDistribution(mu, sigma, lambda_)
loss = dist.nll(targets).mean()

# ...
samples, clusters = dist.sample(n=20)  # draw 20 samples

For a more thorough example see example.ipynb.

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

Mixture-Density-Nets-0.1.1.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

Mixture_Density_Nets-0.1.1-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

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