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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file Mixture-Density-Nets-0.1.1.tar.gz
.
File metadata
- Download URL: Mixture-Density-Nets-0.1.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a14ef9b5cbaeb46f579334cd3b15417d5ebb3482e4142d9ce70a135fb9d593b9 |
|
MD5 | 740ab55914e76ec70cf96eca342e35d5 |
|
BLAKE2b-256 | a06e673a54c7766af0d19f21bd42cbc8af98d0118789400f192dfed652b27acb |
File details
Details for the file Mixture_Density_Nets-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: Mixture_Density_Nets-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dac5a95f589be5d88318a744e0765fbbd0af19dd82de0a93b7cd1165ba7a261c |
|
MD5 | 0622c87b4cc1b4c554199f5782df7ee1 |
|
BLAKE2b-256 | 3f701abcae4f795b718dff08d80aa99cbeca0d989b7985ccdcfef06c84f110cc |