pytorch/docs
Nicki Skafte 4bef344210 Implementation of mixture distributions (#22742)
Summary:
Addressing issue https://github.com/pytorch/pytorch/issues/18125
This implements a mixture distributions, where all components are from the same distribution family. Right now the implementation supports the ```mean, variance, sample, log_prob``` methods.

cc: fritzo and neerajprad

- [x] add import and `__all__` string in `torch/distributions/__init__.py`
- [x] register docs in docs/source/distributions.rst

### Tests
(all tests live in tests/distributions.py)
- [x] add an `Example(MixtureSameFamily, [...])` to the `EXAMPLES` list,
     populating `[...]` with three examples:
     one with `Normal`, one with `Categorical`, and one with `MultivariateNormal`
     (to exercise, `FloatTensor`, `LongTensor`, and nontrivial `event_dim`)
- [x] add a `test_mixture_same_family_shape()` to `TestDistributions`. It would be good to test this with both `Normal` and `MultivariateNormal`
- [x] add a `test_mixture_same_family_log_prob()` to `TestDistributions`.
- [x] add a `test_mixture_same_family_sample()` to `TestDistributions`.
- [x] add a `test_mixture_same_family_shape()` to `TestDistributionShapes`

### Triaged for follup-up PR?
- support batch shape
- implement `.expand()`
- implement `kl_divergence()` in torch/distributions/kl.py
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22742

Differential Revision: D19899726

Pulled By: ezyang

fbshipit-source-id: 9c816e83a2ef104fe3ea3117c95680b51c7a2fa4
2020-02-14 10:31:56 -08:00
..
caffe2 Fix interpreter lines for files with python2-only syntax. 2019-07-09 10:51:43 -07:00
cpp Synchronize with ShipIt. 2020-01-21 13:39:28 -05:00
source Implementation of mixture distributions (#22742) 2020-02-14 10:31:56 -08:00
.gitignore .gitignore for the docs folder 2019-10-08 12:18:30 -07:00
libtorch.rst Update libtorch docs (#21150) 2019-05-30 12:49:56 -07:00
make.bat Convert all tabs to spaces, add CI. (#18959) 2019-04-09 08:12:26 -07:00
Makefile Rewrite http://pytorch.org -> https://pytorch.org throughout project (#12636) 2018-10-15 13:03:27 -07:00
requirements.txt Revert D19320493: Javadoc changes 2020-01-09 14:23:30 -08:00