# LostTech.TensorFlow : API Documentation

Type Bernoulli

Namespace tensorflow.distributions

Parent Distribution

Interfaces IBernoulli

Bernoulli distribution.

The Bernoulli distribution with `probs` parameter, i.e., the probability of a `1` outcome (vs a `0` outcome).

### Public instance methods

#### objectcdf(double value, string name)

Cumulative distribution function.

Given random variable `X`, the cumulative distribution function `cdf` is:

```none cdf(x) := P[X <= x] ```
##### Parameters
`double` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectcdf(ndarray value, string name)

Cumulative distribution function.

Given random variable `X`, the cumulative distribution function `cdf` is:

```none cdf(x) := P[X <= x] ```
##### Parameters
`ndarray` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectcdf(IEnumerable<double> value, string name)

Cumulative distribution function.

Given random variable `X`, the cumulative distribution function `cdf` is:

```none cdf(x) := P[X <= x] ```
##### Parameters
`IEnumerable<double>` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectcdf(IGraphNodeBase value, string name)

Cumulative distribution function.

Given random variable `X`, the cumulative distribution function `cdf` is:

```none cdf(x) := P[X <= x] ```
##### Parameters
`IGraphNodeBase` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectcdf(int value, string name)

Cumulative distribution function.

Given random variable `X`, the cumulative distribution function `cdf` is:

```none cdf(x) := P[X <= x] ```
##### Parameters
`int` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectcdf(IndexedSlices value, string name)

Cumulative distribution function.

Given random variable `X`, the cumulative distribution function `cdf` is:

```none cdf(x) := P[X <= x] ```
##### Parameters
`IndexedSlices` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectcdf_dyn(object value, ImplicitContainer<T> name)

Cumulative distribution function.

Given random variable `X`, the cumulative distribution function `cdf` is:

```none cdf(x) := P[X <= x] ```
##### Parameters
`object` value
`float` or `double` `Tensor`.
`ImplicitContainer<T>` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectcopy(IDictionary<string, object> override_parameters_kwargs)

Creates a deep copy of the distribution.

Note: the copy distribution may continue to depend on the original initialization arguments.
##### Parameters
`IDictionary<string, object>` override_parameters_kwargs
String/value dictionary of initialization arguments to override with new values.
`object`

#### objectcopy_dyn(IDictionary<string, object> override_parameters_kwargs)

Creates a deep copy of the distribution.

Note: the copy distribution may continue to depend on the original initialization arguments.
##### Parameters
`IDictionary<string, object>` override_parameters_kwargs
String/value dictionary of initialization arguments to override with new values.
`object`

#### Tensorevent_shape_tensor(string name)

Shape of a single sample from a single batch as a 1-D int32 `Tensor`.
##### Parameters
`string` name
name to give to the op
`Tensor`

#### objectevent_shape_tensor_dyn(ImplicitContainer<T> name)

Shape of a single sample from a single batch as a 1-D int32 `Tensor`.
##### Parameters
`ImplicitContainer<T>` name
name to give to the op
`object`

#### Tensoris_scalar_batch(string name)

Indicates that `batch_shape == []`.
##### Parameters
`string` name
Python `str` prepended to names of ops created by this function.
`Tensor`

#### objectis_scalar_batch_dyn(ImplicitContainer<T> name)

Indicates that `batch_shape == []`.
##### Parameters
`ImplicitContainer<T>` name
Python `str` prepended to names of ops created by this function.
`object`

#### Tensoris_scalar_event(string name)

Indicates that `event_shape == []`.
##### Parameters
`string` name
Python `str` prepended to names of ops created by this function.
`Tensor`

#### objectis_scalar_event_dyn(ImplicitContainer<T> name)

Indicates that `event_shape == []`.
##### Parameters
`ImplicitContainer<T>` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectlog_cdf(IGraphNodeBase value, string name)

Log cumulative distribution function.

Given random variable `X`, the cumulative distribution function `cdf` is:

```none log_cdf(x) := Log[ P[X <= x] ] ```

Often, a numerical approximation can be used for `log_cdf(x)` that yields a more accurate answer than simply taking the logarithm of the `cdf` when `x << -1`.
##### Parameters
`IGraphNodeBase` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectlog_cdf(IndexedSlices value, string name)

Log cumulative distribution function.

Given random variable `X`, the cumulative distribution function `cdf` is:

```none log_cdf(x) := Log[ P[X <= x] ] ```

Often, a numerical approximation can be used for `log_cdf(x)` that yields a more accurate answer than simply taking the logarithm of the `cdf` when `x << -1`.
##### Parameters
`IndexedSlices` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectlog_cdf(IEnumerable<double> value, string name)

Log cumulative distribution function.

Given random variable `X`, the cumulative distribution function `cdf` is:

```none log_cdf(x) := Log[ P[X <= x] ] ```

Often, a numerical approximation can be used for `log_cdf(x)` that yields a more accurate answer than simply taking the logarithm of the `cdf` when `x << -1`.
##### Parameters
`IEnumerable<double>` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectlog_cdf(ndarray value, string name)

Log cumulative distribution function.

Given random variable `X`, the cumulative distribution function `cdf` is:

```none log_cdf(x) := Log[ P[X <= x] ] ```

Often, a numerical approximation can be used for `log_cdf(x)` that yields a more accurate answer than simply taking the logarithm of the `cdf` when `x << -1`.
##### Parameters
`ndarray` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectlog_cdf(double value, string name)

Log cumulative distribution function.

Given random variable `X`, the cumulative distribution function `cdf` is:

```none log_cdf(x) := Log[ P[X <= x] ] ```

Often, a numerical approximation can be used for `log_cdf(x)` that yields a more accurate answer than simply taking the logarithm of the `cdf` when `x << -1`.
##### Parameters
`double` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectlog_cdf_dyn(object value, ImplicitContainer<T> name)

Log cumulative distribution function.

Given random variable `X`, the cumulative distribution function `cdf` is:

```none log_cdf(x) := Log[ P[X <= x] ] ```

Often, a numerical approximation can be used for `log_cdf(x)` that yields a more accurate answer than simply taking the logarithm of the `cdf` when `x << -1`.
##### Parameters
`object` value
`float` or `double` `Tensor`.
`ImplicitContainer<T>` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectlog_prob(object value, string name)

Log probability density/mass function.
##### Parameters
`object` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectlog_prob_dyn(object value, ImplicitContainer<T> name)

Log probability density/mass function.
##### Parameters
`object` value
`float` or `double` `Tensor`.
`ImplicitContainer<T>` name
Python `str` prepended to names of ops created by this function.
`object`

#### Tensorlog_survival_function(ndarray value, string name)

Log survival function.

Given random variable `X`, the survival function is defined:

```none log_survival_function(x) = Log[ P[X > x] ] = Log[ 1 - P[X <= x] ] = Log[ 1 - cdf(x) ] ```

Typically, different numerical approximations can be used for the log survival function, which are more accurate than `1 - cdf(x)` when `x >> 1`.
##### Parameters
`ndarray` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
##### Returns
`Tensor`
`Tensor` of shape `sample_shape(x) + self.batch_shape` with values of type `self.dtype`.

#### objectprob(int value, string name)

Probability density/mass function.
##### Parameters
`int` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectprob(IEnumerable<double> value, string name)

Probability density/mass function.
##### Parameters
`IEnumerable<double>` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectprob(ndarray value, string name)

Probability density/mass function.
##### Parameters
`ndarray` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectprob(double value, string name)

Probability density/mass function.
##### Parameters
`double` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectprob(IGraphNodeBase value, string name)

Probability density/mass function.
##### Parameters
`IGraphNodeBase` value
`float` or `double` `Tensor`.
`string` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectprob_dyn(object value, ImplicitContainer<T> name)

Probability density/mass function.
##### Parameters
`object` value
`float` or `double` `Tensor`.
`ImplicitContainer<T>` name
Python `str` prepended to names of ops created by this function.
`object`

#### objectsample(IGraphNodeBase sample_shape, Nullable<int> seed, string name)

Generate samples of the specified shape.

Note that a call to `sample()` without arguments will generate a single sample.
##### Parameters
`IGraphNodeBase` sample_shape
0D or 1D `int32` `Tensor`. Shape of the generated samples.
`Nullable<int>` seed
Python integer seed for RNG
`string` name
name to give to the op.
`object`

#### objectsample(int sample_shape, Nullable<int> seed, string name)

Generate samples of the specified shape.

Note that a call to `sample()` without arguments will generate a single sample.
##### Parameters
`int` sample_shape
0D or 1D `int32` `Tensor`. Shape of the generated samples.
`Nullable<int>` seed
Python integer seed for RNG
`string` name
name to give to the op.
`object`

#### objectsample(ImplicitContainer<T> sample_shape, Nullable<int> seed, string name)

Generate samples of the specified shape.

Note that a call to `sample()` without arguments will generate a single sample.
##### Parameters
`ImplicitContainer<T>` sample_shape
0D or 1D `int32` `Tensor`. Shape of the generated samples.
`Nullable<int>` seed
Python integer seed for RNG
`string` name
name to give to the op.
`object`

#### objectsample(ValueTuple<int, object> sample_shape, Nullable<int> seed, string name)

Generate samples of the specified shape.

Note that a call to `sample()` without arguments will generate a single sample.
##### Parameters
`ValueTuple<int, object>` sample_shape
0D or 1D `int32` `Tensor`. Shape of the generated samples.
`Nullable<int>` seed
Python integer seed for RNG
`string` name
name to give to the op.
`object`

#### objectsample(IEnumerable<int> sample_shape, Nullable<int> seed, string name)

Generate samples of the specified shape.

Note that a call to `sample()` without arguments will generate a single sample.
##### Parameters
`IEnumerable<int>` sample_shape
0D or 1D `int32` `Tensor`. Shape of the generated samples.
`Nullable<int>` seed
Python integer seed for RNG
`string` name
name to give to the op.
`object`

#### objectsample_dyn(ImplicitContainer<T> sample_shape, object seed, ImplicitContainer<T> name)

Generate samples of the specified shape.

Note that a call to `sample()` without arguments will generate a single sample.
##### Parameters
`ImplicitContainer<T>` sample_shape
0D or 1D `int32` `Tensor`. Shape of the generated samples.
`object` seed
Python integer seed for RNG
`ImplicitContainer<T>` name
name to give to the op.
`object`

### Public static methods

#### BernoulliNewDyn(object logits, object probs, ImplicitContainer<T> dtype, ImplicitContainer<T> validate_args, ImplicitContainer<T> allow_nan_stats, ImplicitContainer<T> name)

Initialize Categorical distributions using class log-probabilities. (deprecated)

Warning: THIS FUNCTION IS DEPRECATED. It will be removed after 2019-01-01. Instructions for updating: The TensorFlow Distributions library has moved to TensorFlow Probability (https://github.com/tensorflow/probability). You should update all references to use `tfp.distributions` instead of `tf.distributions`.
##### Parameters
`object` logits
An N-D `Tensor`, `N >= 1`, representing the log probabilities of a set of Categorical distributions. The first `N - 1` dimensions index into a batch of independent distributions and the last dimension represents a vector of logits for each class. Only one of `logits` or `probs` should be passed in.
`object` probs
An N-D `Tensor`, `N >= 1`, representing the probabilities of a set of Categorical distributions. The first `N - 1` dimensions index into a batch of independent distributions and the last dimension represents a vector of probabilities for each class. Only one of `logits` or `probs` should be passed in.
`ImplicitContainer<T>` dtype
The type of the event samples (default: int32).
`ImplicitContainer<T>` validate_args
Python `bool`, default `False`. When `True` distribution parameters are checked for validity despite possibly degrading runtime performance. When `False` invalid inputs may silently render incorrect outputs.
`ImplicitContainer<T>` allow_nan_stats
Python `bool`, default `True`. When `True`, statistics (e.g., mean, mode, variance) use the value "`NaN`" to indicate the result is undefined. When `False`, an exception is raised if one or more of the statistic's batch members are undefined.
`ImplicitContainer<T>` name
Python `str` name prefixed to Ops created by this class.

### Public properties

#### objectlogits get;

Log-odds of a `1` outcome (vs `0`).

#### objectlogits_dyn get;

Log-odds of a `1` outcome (vs `0`).

#### Tensorprobs get;

Probability of a `1` outcome (vs `0`).

#### objectprobs_dyn get;

Probability of a `1` outcome (vs `0`).