Commit Graph

138 Commits

Author SHA1 Message Date
Alican Bozkurt
9b6441ecbc Implement Multinomial distribution (#4624) 2018-01-13 11:26:14 +01:00
Neeraj Pradhan
736190fc78 Allow broadcasting of value x params in Categorical (#4614) 2018-01-12 12:16:19 +01:00
Fritz Obermeyer
71b1120ba8 Fix bug in Dirichlet.rsample(); add tests (#4602)
* Fix bug in Dirichlet.rsample(); add tests

* Address review comments
2018-01-11 12:29:10 -05:00
Fritz Obermeyer
8cff8e93d2 Add torch.distributions.utils._finfo for numerical stability (#4572)
* Add torch.distributions.utils.finfo

* Make _finfo private

* Address review comments

* Simplify _finfo() to key on Storage type
2018-01-10 21:42:47 -05:00
Fritz Obermeyer
3a335427b0 Start framework for kl_divergence(-,-) in torch.distributions (#4525) 2018-01-09 09:44:59 +01:00
Vishwak Srinivasan
5d6a5cf3a7 Implementation of Gumbel Distribution (#4517) 2018-01-08 23:21:27 +01:00
Neeraj Pradhan
8fe3d287b2 Fix return type for Bernoulli enumerate_support (#4529) 2018-01-08 23:17:43 +01:00
Alican Bozkurt
c9bc6c2bc3 Implement Student's t-distribution (#4510) 2018-01-08 10:23:48 +01:00
Neeraj Pradhan
408c84de7c Supporting logits as parameters in Bernoulli and Categorical (#4448)
* Supporting logits as parameters in Bernoulli and Categorical

* address comments

* fix lint

* modify binary_cross_entropy_with_logits

* address comments

* add descriptor for lazy attributes

* address comments
2018-01-05 03:45:05 -05:00
Fritz Obermeyer
a3e91515de Declare constraints for distribution parameters and support (#4450) 2018-01-04 23:58:26 +01:00
Vishwak Srinivasan
1e76ade9dc Implementation of Pareto Distribution (#4459) 2018-01-04 22:57:47 +01:00
Fritz Obermeyer
43ab911182 Improve precision of dirichlet_grad() approximation (#4421) 2018-01-02 20:53:47 +01:00
Alican Bozkurt
02e7eba309 Implement Chi2 distribution (#4425)
* add chi2

* add tests for chi2

* add randomized test comments
2018-01-01 19:41:18 -05:00
Fritz Obermeyer
6185b27cc6 Improve precision of standard_gamma_grad() (#4369) 2017-12-29 12:11:04 +01:00
Neeraj Pradhan
fa8de6b4f3 Adding the Cauchy distribution to torch.distributions 2017-12-29 11:57:21 +01:00
Fritz Obermeyer
5c33400dd3 Implement OneHotCategorical distribution (#4357) 2017-12-28 16:54:55 +01:00
Edward Z. Yang
4453a5402f
allow_inf on test_beta_log_prob (#4354)
* allow_inf on test_beta_log_prob
* Support allow_inf on assertAlmostEqual

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
2017-12-27 09:25:12 -05:00
Neeraj Pradhan
1b608eea4e Fix distribution tests due to merge order (#4351) 2017-12-26 16:37:15 -05:00
Neeraj Pradhan
ffa7fab67f Minor changes to test utils to catch type errors (#4270) 2017-12-26 10:08:33 +01:00
Neeraj Pradhan
0c4b3f4271 Adding Uniform distribution to PyTorch (#4328) 2017-12-23 15:14:44 +01:00
gchanan
3304185c6c
Fix test_gamma_sample_grad. (#4327) 2017-12-22 22:01:04 -05:00
Will Feng
6c4e97220a disable test_gamma_sample_grad until it's fixed (#4324)
* disable test_gamma_sample_grad until we have SciPy in xenial builds

* skip test_gamma_sample_grad until it's fixed
2017-12-22 17:11:15 -05:00
Alican Bozkurt
d7e6ede784 Implement Laplace distribution (#4289) 2017-12-21 17:03:03 +01:00
Fritz Obermeyer
54e11639f9 Fix broken test_beta_log_prob in Python 3.6 (#4261) 2017-12-20 19:41:03 -05:00
Fritz Obermeyer
0bc1505f34 Implement .entropy() methods for all distributions (#4268) 2017-12-20 14:06:01 +01:00
Fritz Obermeyer
69265ea5bc Ensure gamma samples are positive (#4262) 2017-12-20 10:17:31 +01:00
Alican Bozkurt
94ff31f54d Implement Exponential distribution (#4234)
* add exponential distribution

* add exponential tests

* fix default val of sample_shape

* lambd->rate

* updates per review

* remove notes, keep failure_rate same in exponential test
2017-12-18 16:44:35 -05:00
Fritz Obermeyer
ee98e7a82e Implement Dirichlet and Beta distributions (#4117) 2017-12-18 19:11:37 +01:00
Neeraj Pradhan
fac711c238 Provide full support for distribution shapes (#4193) 2017-12-15 12:41:08 +01:00
Alican Bozkurt
7f25fff2fe add reparameterization, combine sample and sample_n (#4142) 2017-12-15 00:25:39 +01:00
Neeraj Pradhan
4f4e0df68f Allow for broadcasting of distribution parameters (#4140) 2017-12-14 09:37:03 +01:00
Fritz Obermeyer
0ab68b8db4 Implement .enumerate_support() for Bernoulli, Categorical distributions (#4129) 2017-12-13 13:01:05 +01:00
Fritz Obermeyer
05ebd21a36 Implement reparameterized gradient for Gamma sampler (#3978) 2017-12-11 03:32:15 -08:00
ngimel
0d68ce9383 Use integer division to fix failing test 2017-12-04 21:16:09 -08:00
Fritz Obermeyer
165d0897e4 Implement distributions.Gamma (#3841) 2017-12-02 01:10:08 +01:00
Fritz Obermeyer
1f64c2ef91 Rename pyro.distributions.Multinomial -> .Categorical (#3766)
* Rename distributions.Multinomial -> distributions.Categorical

* Rename Multinomial -> Categorical

* Update docs

* Update variable.py

* Update distributions.py

* Update variable.py
2017-11-18 16:10:07 -05:00
Geoffrey Roeder
dce525ab6b adds sample_n function (#3249)
* adds sample_n function

* fixes style issues

* uses more efficient api calls

* fix bug where transpose applied to 1 dimension
2017-10-31 09:04:05 -04:00
Sam Gross
d9b89a352c Replace StochasticFunctions v2 (#3165)
This removes the StochasticFunctions for bernoulli, multinomial, and
normal and replaces them with classes in the torch.distributions
package. Each distribution supports the differentiable log_prob function
that returns the log of the pdf/pmf of the samples.

The current StochasticFunction implementation has a few problems: it can
be painful to use when there are multiple stochastic outputs which need
to be back-propagated through. It also requires that we store grad_fns
on Variables that have requires_grad=False in order to find stochastic
nodes.
2017-10-19 15:05:07 -04:00