§
    ŠŠtjÀ  ã                   óh   — d dl mZ d dlmZmZ d dlmZ d dlmZ d dl	m
Z
 dgZ G d„ de¦  «        ZdS )	é    )ÚTensor)ÚconstraintsÚIndependent)ÚNormal)ÚTransformedDistribution)ÚStickBreakingTransformÚLogisticNormalc            	       óÖ   ‡ — e Zd ZU dZej        ej        dœZej        Z	dZ
ee         ed<   	 ddeez  deez  dedz  d	dfˆ fd
„Zdˆ fd„	Zed	efd„¦   «         Zed	efd„¦   «         Zˆ xZS )r	   a9  
    Creates a logistic-normal distribution parameterized by :attr:`loc` and :attr:`scale`
    that define the base `Normal` distribution transformed with the
    `StickBreakingTransform` such that::

        X ~ LogisticNormal(loc, scale)
        Y = log(X / (1 - X.cumsum(-1)))[..., :-1] ~ Normal(loc, scale)

    Args:
        loc (float or Tensor): mean of the base distribution
        scale (float or Tensor): standard deviation of the base distribution

    Example::

        >>> # logistic-normal distributed with mean=(0, 0, 0) and stddev=(1, 1, 1)
        >>> # of the base Normal distribution
        >>> # xdoctest: +IGNORE_WANT("non-deterministic")
        >>> m = LogisticNormal(torch.tensor([0.0] * 3), torch.tensor([1.0] * 3))
        >>> m.sample()
        tensor([ 0.7653,  0.0341,  0.0579,  0.1427])

    )ÚlocÚscaleTÚ	base_distNr   r   Úvalidate_argsÚreturnc                 óÆ   •— t          |||¬¦  «        }|j        s|                     dg¦  «        }t          ¦   «                              |t          ¦   «         |¬¦  «         d S )N)r   é   )r   Úbatch_shapeÚexpandÚsuperÚ__init__r   )Úselfr   r   r   r   Ú	__class__s        €úa/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/torch/distributions/logistic_normal.pyr   zLogisticNormal.__init__,   sr   ø€ õ ˜3 °]ÐCÑCÔCˆ	ØÔ$ð 	.Ø!×(Ò(¨!¨Ñ-Ô-ˆIÝ‰Œ×ÒØÕ-Ñ/Ô/¸}ð 	ñ 	
ô 	
ð 	
ð 	
ð 	
ó    c                 ó€   •— |                       t          |¦  «        }t          ¦   «                              ||¬¦  «        S )N)Ú	_instance)Ú_get_checked_instancer	   r   r   )r   r   r   Únewr   s       €r   r   zLogisticNormal.expand9   s2   ø€ Ø×(Ò(­¸ÑCÔCˆÝ‰wŒw�~Š~˜k°Sˆ~Ñ9Ô9Ð9r   c                 ó$   — | j         j         j        S ©N)r   r   ©r   s    r   r   zLogisticNormal.loc=   s   € àŒ~Ô'Ô+Ð+r   c                 ó$   — | j         j         j        S r   )r   r   r    s    r   r   zLogisticNormal.scaleA   s   € àŒ~Ô'Ô-Ð-r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚrealÚpositiveÚarg_constraintsÚsimplexÚsupportÚhas_rsampler   r   Ú__annotations__r   ÚfloatÚboolr   r   Úpropertyr   r   Ú__classcell__)r   s   @r   r	   r	      s$  ø€ € € € € € ðð ð. *Ô.¸Ô9MÐNÐN€OàÔ!€GØ€Kà˜6Ô"Ð"Ð"Ñ"ð &*ð	
ð 
à�e‰^ð
ð ˜‰~ð
ð ˜d‘{ð	
ð
 
ð
ð 
ð 
ð 
ð 
ð 
ð:ð :ð :ð :ð :ð :ð ð,�Vð ,ð ,ð ,ñ „Xð,ð ð.�vð .ð .ð .ñ „Xð.ð .ð .ð .ð .r   N)Útorchr   Útorch.distributionsr   r   Útorch.distributions.normalr   Ú,torch.distributions.transformed_distributionr   Útorch.distributions.transformsr   Ú__all__r	   © r   r   ú<module>r8      s¦   ðð Ð Ð Ð Ð Ð Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø -Ð -Ð -Ð -Ð -Ð -Ø PÐ PÐ PÐ PÐ PÐ PØ AÐ AÐ AÐ AÐ AÐ Að Ð
€ð6.ð 6.ð 6.ð 6.ð 6.Ð,ñ 6.ô 6.ð 6.ð 6.ð 6.r   