10 Creates a log-normal distribution parameterized by 11 :attr:`loc` and :attr:`scale` where:: 13 X ~ Normal(loc, scale) 14 Y = exp(X) ~ LogNormal(loc, scale) 18 >>> m = LogNormal(torch.tensor([0.0]), torch.tensor([1.0])) 19 >>> m.sample() # log-normal distributed with mean=0 and stddev=1 23 loc (float or Tensor): mean of log of distribution 24 scale (float or Tensor): standard deviation of log of the distribution 26 arg_constraints = {
'loc': constraints.real,
'scale': constraints.positive}
27 support = constraints.positive
30 def __init__(self, loc, scale, validate_args=None):
31 base_dist =
Normal(loc, scale)
32 super(LogNormal, self).__init__(base_dist,
ExpTransform(), validate_args=validate_args)
34 def expand(self, batch_shape, _instance=None):
36 return super(LogNormal, self).expand(batch_shape, _instance=new)
40 return self.base_dist.loc
44 return self.base_dist.scale
48 return (self.
loc + self.scale.pow(2) / 2).exp()
52 return (self.scale.pow(2).exp() - 1) * (2 * self.
loc + self.scale.pow(2)).exp()
55 return self.base_dist.entropy() + self.
loc
def _get_checked_instance(self, cls, _instance=None)