tfp.edward2.Bernoulli(
*args,
**kwargs
)
Create a random variable for Bernoulli.
See Bernoulli for more details.
Returns:
RandomVariable.
Original Docstring for Distribution
Construct Bernoulli distributions.
Args:
logits
: An N-DTensor
representing the log-odds of a1
event. Each entry in theTensor
parametrizes an independent Bernoulli distribution where the probability of an event is sigmoid(logits). Only one oflogits
orprobs
should be passed in.probs
: An N-DTensor
representing the probability of a1
event. Each entry in theTensor
parameterizes an independent Bernoulli distribution. Only one oflogits
orprobs
should be passed in.dtype
: The type of the event samples. Default:int32
.validate_args
: Pythonbool
, defaultFalse
. WhenTrue
distribution parameters are checked for validity despite possibly degrading runtime performance. WhenFalse
invalid inputs may silently render incorrect outputs.allow_nan_stats
: Pythonbool
, defaultTrue
. WhenTrue
, statistics (e.g., mean, mode, variance) use the value "NaN
" to indicate the result is undefined. WhenFalse
, an exception is raised if one or more of the statistic's batch members are undefined.name
: Pythonstr
name prefixed to Ops created by this class.
Raises:
ValueError
: If p and logits are passed, or if neither are passed.