LostTech.TensorFlow : API Documentation

Type RelaxedOneHotCategorical

Namespace tensorflow.contrib.distributions

Parent TransformedDistribution

Interfaces IRelaxedOneHotCategorical

RelaxedOneHotCategorical distribution with temperature and logits.

The RelaxedOneHotCategorical is a distribution over random probability vectors, vectors of positive real values that sum to one, which continuously approximates a OneHotCategorical. The degree of approximation is controlled by a temperature: as the temperature goes to 0 the RelaxedOneHotCategorical becomes discrete with a distribution described by the `logits` or `probs` parameters, as the temperature goes to infinity the RelaxedOneHotCategorical becomes the constant distribution that is identically the constant vector of (1/event_size,..., 1/event_size).

The RelaxedOneHotCategorical distribution was concurrently introduced as the Gumbel-Softmax (Jang et al., 2016) and Concrete (Maddison et al., 2016) distributions for use as a reparameterized continuous approximation to the `Categorical` one-hot distribution. If you use this distribution, please cite both papers.

#### Examples

Creates a continuous distribution, which approximates a 3-class one-hot categorical distribution. The 2nd class is the most likely to be the largest component in samples drawn from this distribution. Creates a continuous distribution, which approximates a 3-class one-hot categorical distribution. The 2nd class is the most likely to be the largest component in samples drawn from this distribution. Creates a continuous distribution, which approximates a 3-class one-hot categorical distribution. Because the temperature is very low, samples from this distribution are almost discrete, with one component almost 1 and the others nearly 0. The 2nd class is the most likely to be the largest component in samples drawn from this distribution. Creates a continuous distribution, which approximates a 3-class one-hot categorical distribution. Because the temperature is very high, samples from this distribution are usually close to the (1/3, 1/3, 1/3) vector. The 2nd class is still the most likely to be the largest component in samples drawn from this distribution. Eric Jang, Shixiang Gu, and Ben Poole. Categorical Reparameterization with Gumbel-Softmax. 2016.

Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. The Concrete Distribution: A Continuous Relaxation of Discrete Random Variables. 2016.
Show Example
temperature = 0.5
            p = [0.1, 0.5, 0.4]
            dist = RelaxedOneHotCategorical(temperature, probs=p) 

Properties

Public properties

object allow_nan_stats get;

object allow_nan_stats_dyn get;

TensorShape batch_shape get;

object batch_shape_dyn get;

object bijector get;

object bijector_dyn get;

object distribution get;

object distribution_dyn get;

object dtype get;

object dtype_dyn get;

TensorShape event_shape get;

object event_shape_dyn get;

string name get;

object name_dyn get;

IDictionary<object, object> parameters get;

object parameters_dyn get;

object PythonObject get;

object reparameterization_type get;

object reparameterization_type_dyn get;

object validate_args get;

object validate_args_dyn get;