[docs]classLogNormal(TransformedDistribution):r""" Creates a log-normal distribution parameterized by :attr:`loc` and :attr:`scale` where:: X ~ Normal(loc, scale) Y = exp(X) ~ LogNormal(loc, scale) Example:: >>> # xdoctest: +IGNORE_WANT("non-deterinistic") >>> m = LogNormal(torch.tensor([0.0]), torch.tensor([1.0])) >>> m.sample() # log-normal distributed with mean=0 and stddev=1 tensor([ 0.1046]) Args: loc (float or Tensor): mean of log of distribution scale (float or Tensor): standard deviation of log of the distribution """arg_constraints={"loc":constraints.real,"scale":constraints.positive}support=constraints.positivehas_rsample=Truedef__init__(self,loc,scale,validate_args=None):base_dist=Normal(loc,scale,validate_args=validate_args)super().__init__(base_dist,ExpTransform(),validate_args=validate_args)
To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.