Skip to content

Commit

Permalink
Update documentation of Mixture to suggest preferring MixtureSameFami…
Browse files Browse the repository at this point in the history
…ly when possible.

PiperOrigin-RevId: 335928374
  • Loading branch information
axch authored and tensorflower-gardener committed Oct 7, 2020
1 parent ea5351d commit c0ad7fa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tensorflow_probability/python/distributions/mixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ class Mixture(distribution.Distribution):
The mixture model is defined by a `Categorical` distribution (the mixture)
and a python list of `Distribution` objects.
In the common case that the component distributions are all the same
`Distribution` class (potentially with different parameters), it's probably
better to use `tfp.distributions.MixtureSameFamily` instead.
Methods supported include `log_prob`, `prob`, `mean`, `sample`, and
`entropy_lower_bound`.
Expand Down Expand Up @@ -93,6 +97,10 @@ def __init__(self,
The `num_classes` of `cat` must be possible to infer at graph construction
time and match `len(components)`.
In the common case that the component distributions are all the same
`Distribution` class (potentially with different parameters), it's probably
better to use `tfp.distributions.MixtureSameFamily` instead.
Args:
cat: A `Categorical` distribution instance, representing the probabilities
of `distributions`.
Expand Down

0 comments on commit c0ad7fa

Please sign in to comment.