doc_content
stringlengths
1
386k
doc_id
stringlengths
5
188
support = Real()
torch.distributions#torch.distributions.cauchy.Cauchy.support
property variance
torch.distributions#torch.distributions.cauchy.Cauchy.variance
class torch.distributions.chi2.Chi2(df, validate_args=None) [source] Bases: torch.distributions.gamma.Gamma Creates a Chi2 distribution parameterized by shape parameter df. This is exactly equivalent to Gamma(alpha=0.5*df, beta=0.5) Example: >>> m = Chi2(torch.tensor([1.0])) >>> m.sample() # Chi2 distributed with sh...
torch.distributions#torch.distributions.chi2.Chi2
arg_constraints = {'df': GreaterThan(lower_bound=0.0)}
torch.distributions#torch.distributions.chi2.Chi2.arg_constraints
property df
torch.distributions#torch.distributions.chi2.Chi2.df
expand(batch_shape, _instance=None) [source]
torch.distributions#torch.distributions.chi2.Chi2.expand
torch.distributions.constraints.cat alias of torch.distributions.constraints._Cat
torch.distributions#torch.distributions.constraints.cat
class torch.distributions.constraints.Constraint [source] Abstract base class for constraints. A constraint object represents a region over which a variable is valid, e.g. within which a variable can be optimized. Variables ~Constraint.is_discrete (bool) – Whether constrained space is discrete. Defaults to False....
torch.distributions#torch.distributions.constraints.Constraint
check(value) [source] Returns a byte tensor of sample_shape + batch_shape indicating whether each event in value satisfies this constraint.
torch.distributions#torch.distributions.constraints.Constraint.check
torch.distributions.constraints.dependent_property alias of torch.distributions.constraints._DependentProperty
torch.distributions#torch.distributions.constraints.dependent_property
torch.distributions.constraints.greater_than alias of torch.distributions.constraints._GreaterThan
torch.distributions#torch.distributions.constraints.greater_than
torch.distributions.constraints.greater_than_eq alias of torch.distributions.constraints._GreaterThanEq
torch.distributions#torch.distributions.constraints.greater_than_eq
torch.distributions.constraints.half_open_interval alias of torch.distributions.constraints._HalfOpenInterval
torch.distributions#torch.distributions.constraints.half_open_interval
torch.distributions.constraints.independent alias of torch.distributions.constraints._IndependentConstraint
torch.distributions#torch.distributions.constraints.independent
torch.distributions.constraints.integer_interval alias of torch.distributions.constraints._IntegerInterval
torch.distributions#torch.distributions.constraints.integer_interval
torch.distributions.constraints.interval alias of torch.distributions.constraints._Interval
torch.distributions#torch.distributions.constraints.interval
torch.distributions.constraints.less_than alias of torch.distributions.constraints._LessThan
torch.distributions#torch.distributions.constraints.less_than
torch.distributions.constraints.multinomial alias of torch.distributions.constraints._Multinomial
torch.distributions#torch.distributions.constraints.multinomial
torch.distributions.constraints.stack alias of torch.distributions.constraints._Stack
torch.distributions#torch.distributions.constraints.stack
class torch.distributions.constraint_registry.ConstraintRegistry [source] Registry to link constraints to transforms. register(constraint, factory=None) [source] Registers a Constraint subclass in this registry. Usage: @my_registry.register(MyConstraintClass) def construct_transform(constraint): assert isinst...
torch.distributions#torch.distributions.constraint_registry.ConstraintRegistry
register(constraint, factory=None) [source] Registers a Constraint subclass in this registry. Usage: @my_registry.register(MyConstraintClass) def construct_transform(constraint): assert isinstance(constraint, MyConstraint) return MyTransform(constraint.arg_constraints) Parameters constraint (subclass of ...
torch.distributions#torch.distributions.constraint_registry.ConstraintRegistry.register
class torch.distributions.continuous_bernoulli.ContinuousBernoulli(probs=None, logits=None, lims=(0.499, 0.501), validate_args=None) [source] Bases: torch.distributions.exp_family.ExponentialFamily Creates a continuous Bernoulli distribution parameterized by probs or logits (but not both). The distribution is support...
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli
arg_constraints = {'logits': Real(), 'probs': Interval(lower_bound=0.0, upper_bound=1.0)}
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.arg_constraints
cdf(value) [source]
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.cdf
entropy() [source]
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.entropy
expand(batch_shape, _instance=None) [source]
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.expand
has_rsample = True
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.has_rsample
icdf(value) [source]
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.icdf
logits [source]
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.logits
log_prob(value) [source]
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.log_prob
property mean
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.mean
property param_shape
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.param_shape
probs [source]
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.probs
rsample(sample_shape=torch.Size([])) [source]
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.rsample
sample(sample_shape=torch.Size([])) [source]
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.sample
property stddev
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.stddev
support = Interval(lower_bound=0.0, upper_bound=1.0)
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.support
property variance
torch.distributions#torch.distributions.continuous_bernoulli.ContinuousBernoulli.variance
class torch.distributions.dirichlet.Dirichlet(concentration, validate_args=None) [source] Bases: torch.distributions.exp_family.ExponentialFamily Creates a Dirichlet distribution parameterized by concentration concentration. Example: >>> m = Dirichlet(torch.tensor([0.5, 0.5])) >>> m.sample() # Dirichlet distributed ...
torch.distributions#torch.distributions.dirichlet.Dirichlet
arg_constraints = {'concentration': IndependentConstraint(GreaterThan(lower_bound=0.0), 1)}
torch.distributions#torch.distributions.dirichlet.Dirichlet.arg_constraints
entropy() [source]
torch.distributions#torch.distributions.dirichlet.Dirichlet.entropy
expand(batch_shape, _instance=None) [source]
torch.distributions#torch.distributions.dirichlet.Dirichlet.expand
has_rsample = True
torch.distributions#torch.distributions.dirichlet.Dirichlet.has_rsample
log_prob(value) [source]
torch.distributions#torch.distributions.dirichlet.Dirichlet.log_prob
property mean
torch.distributions#torch.distributions.dirichlet.Dirichlet.mean
rsample(sample_shape=()) [source]
torch.distributions#torch.distributions.dirichlet.Dirichlet.rsample
support = Simplex()
torch.distributions#torch.distributions.dirichlet.Dirichlet.support
property variance
torch.distributions#torch.distributions.dirichlet.Dirichlet.variance
class torch.distributions.distribution.Distribution(batch_shape=torch.Size([]), event_shape=torch.Size([]), validate_args=None) [source] Bases: object Distribution is the abstract base class for probability distributions. property arg_constraints Returns a dictionary from argument names to Constraint objects that...
torch.distributions#torch.distributions.distribution.Distribution
property arg_constraints Returns a dictionary from argument names to Constraint objects that should be satisfied by each argument of this distribution. Args that are not tensors need not appear in this dict.
torch.distributions#torch.distributions.distribution.Distribution.arg_constraints
property batch_shape Returns the shape over which parameters are batched.
torch.distributions#torch.distributions.distribution.Distribution.batch_shape
cdf(value) [source] Returns the cumulative density/mass function evaluated at value. Parameters value (Tensor) –
torch.distributions#torch.distributions.distribution.Distribution.cdf
entropy() [source] Returns entropy of distribution, batched over batch_shape. Returns Tensor of shape batch_shape.
torch.distributions#torch.distributions.distribution.Distribution.entropy
enumerate_support(expand=True) [source] Returns tensor containing all values supported by a discrete distribution. The result will enumerate over dimension 0, so the shape of the result will be (cardinality,) + batch_shape + event_shape (where event_shape = () for univariate distributions). Note that this enumerates ...
torch.distributions#torch.distributions.distribution.Distribution.enumerate_support
property event_shape Returns the shape of a single sample (without batching).
torch.distributions#torch.distributions.distribution.Distribution.event_shape
expand(batch_shape, _instance=None) [source] Returns a new distribution instance (or populates an existing instance provided by a derived class) with batch dimensions expanded to batch_shape. This method calls expand on the distribution’s parameters. As such, this does not allocate new memory for the expanded distrib...
torch.distributions#torch.distributions.distribution.Distribution.expand
icdf(value) [source] Returns the inverse cumulative density/mass function evaluated at value. Parameters value (Tensor) –
torch.distributions#torch.distributions.distribution.Distribution.icdf
log_prob(value) [source] Returns the log of the probability density/mass function evaluated at value. Parameters value (Tensor) –
torch.distributions#torch.distributions.distribution.Distribution.log_prob
property mean Returns the mean of the distribution.
torch.distributions#torch.distributions.distribution.Distribution.mean
perplexity() [source] Returns perplexity of distribution, batched over batch_shape. Returns Tensor of shape batch_shape.
torch.distributions#torch.distributions.distribution.Distribution.perplexity
rsample(sample_shape=torch.Size([])) [source] Generates a sample_shape shaped reparameterized sample or sample_shape shaped batch of reparameterized samples if the distribution parameters are batched.
torch.distributions#torch.distributions.distribution.Distribution.rsample
sample(sample_shape=torch.Size([])) [source] Generates a sample_shape shaped sample or sample_shape shaped batch of samples if the distribution parameters are batched.
torch.distributions#torch.distributions.distribution.Distribution.sample
sample_n(n) [source] Generates n samples or n batches of samples if the distribution parameters are batched.
torch.distributions#torch.distributions.distribution.Distribution.sample_n
static set_default_validate_args(value) [source] Sets whether validation is enabled or disabled. The default behavior mimics Python’s assert statement: validation is on by default, but is disabled if Python is run in optimized mode (via python -O). Validation may be expensive, so you may want to disable it once a mod...
torch.distributions#torch.distributions.distribution.Distribution.set_default_validate_args
property stddev Returns the standard deviation of the distribution.
torch.distributions#torch.distributions.distribution.Distribution.stddev
property support Returns a Constraint object representing this distribution’s support.
torch.distributions#torch.distributions.distribution.Distribution.support
property variance Returns the variance of the distribution.
torch.distributions#torch.distributions.distribution.Distribution.variance
class torch.distributions.exponential.Exponential(rate, validate_args=None) [source] Bases: torch.distributions.exp_family.ExponentialFamily Creates a Exponential distribution parameterized by rate. Example: >>> m = Exponential(torch.tensor([1.0])) >>> m.sample() # Exponential distributed with rate=1 tensor([ 0.1046...
torch.distributions#torch.distributions.exponential.Exponential
arg_constraints = {'rate': GreaterThan(lower_bound=0.0)}
torch.distributions#torch.distributions.exponential.Exponential.arg_constraints
cdf(value) [source]
torch.distributions#torch.distributions.exponential.Exponential.cdf
entropy() [source]
torch.distributions#torch.distributions.exponential.Exponential.entropy
expand(batch_shape, _instance=None) [source]
torch.distributions#torch.distributions.exponential.Exponential.expand
has_rsample = True
torch.distributions#torch.distributions.exponential.Exponential.has_rsample
icdf(value) [source]
torch.distributions#torch.distributions.exponential.Exponential.icdf
log_prob(value) [source]
torch.distributions#torch.distributions.exponential.Exponential.log_prob
property mean
torch.distributions#torch.distributions.exponential.Exponential.mean
rsample(sample_shape=torch.Size([])) [source]
torch.distributions#torch.distributions.exponential.Exponential.rsample
property stddev
torch.distributions#torch.distributions.exponential.Exponential.stddev
support = GreaterThan(lower_bound=0.0)
torch.distributions#torch.distributions.exponential.Exponential.support
property variance
torch.distributions#torch.distributions.exponential.Exponential.variance
class torch.distributions.exp_family.ExponentialFamily(batch_shape=torch.Size([]), event_shape=torch.Size([]), validate_args=None) [source] Bases: torch.distributions.distribution.Distribution ExponentialFamily is the abstract base class for probability distributions belonging to an exponential family, whose probabil...
torch.distributions#torch.distributions.exp_family.ExponentialFamily
entropy() [source] Method to compute the entropy using Bregman divergence of the log normalizer.
torch.distributions#torch.distributions.exp_family.ExponentialFamily.entropy
class torch.distributions.fishersnedecor.FisherSnedecor(df1, df2, validate_args=None) [source] Bases: torch.distributions.distribution.Distribution Creates a Fisher-Snedecor distribution parameterized by df1 and df2. Example: >>> m = FisherSnedecor(torch.tensor([1.0]), torch.tensor([2.0])) >>> m.sample() # Fisher-Sn...
torch.distributions#torch.distributions.fishersnedecor.FisherSnedecor
arg_constraints = {'df1': GreaterThan(lower_bound=0.0), 'df2': GreaterThan(lower_bound=0.0)}
torch.distributions#torch.distributions.fishersnedecor.FisherSnedecor.arg_constraints
expand(batch_shape, _instance=None) [source]
torch.distributions#torch.distributions.fishersnedecor.FisherSnedecor.expand
has_rsample = True
torch.distributions#torch.distributions.fishersnedecor.FisherSnedecor.has_rsample
log_prob(value) [source]
torch.distributions#torch.distributions.fishersnedecor.FisherSnedecor.log_prob
property mean
torch.distributions#torch.distributions.fishersnedecor.FisherSnedecor.mean
rsample(sample_shape=torch.Size([])) [source]
torch.distributions#torch.distributions.fishersnedecor.FisherSnedecor.rsample
support = GreaterThan(lower_bound=0.0)
torch.distributions#torch.distributions.fishersnedecor.FisherSnedecor.support
property variance
torch.distributions#torch.distributions.fishersnedecor.FisherSnedecor.variance
class torch.distributions.gamma.Gamma(concentration, rate, validate_args=None) [source] Bases: torch.distributions.exp_family.ExponentialFamily Creates a Gamma distribution parameterized by shape concentration and rate. Example: >>> m = Gamma(torch.tensor([1.0]), torch.tensor([1.0])) >>> m.sample() # Gamma distribut...
torch.distributions#torch.distributions.gamma.Gamma
arg_constraints = {'concentration': GreaterThan(lower_bound=0.0), 'rate': GreaterThan(lower_bound=0.0)}
torch.distributions#torch.distributions.gamma.Gamma.arg_constraints
entropy() [source]
torch.distributions#torch.distributions.gamma.Gamma.entropy
expand(batch_shape, _instance=None) [source]
torch.distributions#torch.distributions.gamma.Gamma.expand
has_rsample = True
torch.distributions#torch.distributions.gamma.Gamma.has_rsample
log_prob(value) [source]
torch.distributions#torch.distributions.gamma.Gamma.log_prob
property mean
torch.distributions#torch.distributions.gamma.Gamma.mean
rsample(sample_shape=torch.Size([])) [source]
torch.distributions#torch.distributions.gamma.Gamma.rsample
support = GreaterThan(lower_bound=0.0)
torch.distributions#torch.distributions.gamma.Gamma.support