+
    QV-j8  ã                   ó  € R t ^ RIHt ^ RIt^ RIHt ^ RIHtHtHtH	t	H
t
HtHt  ! R R]4      t ! R R]P                  4      t ! R	 R
]P                  4      t ! R R4      t ! R R]4      t ! R R]4      t ! R R]4      tR# )z:
Time series distributional output classes and utilities.
)ÚCallableN)Únn)ÚAffineTransformÚDistributionÚIndependentÚNegativeBinomialÚNormalÚStudentTÚTransformedDistributionc                   ór   a a€ ] tR t^"t oRV3R lV 3R lllt]R 4       t]R 4       t]R 4       tRt	Vt
V ;t# )ÚAffineTransformedc                ó    <€ V ^8„  d   QhRS[ /# )é   Úbase_distribution©r   )ÚformatÚ__classdict__s   "€Úo/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/transformers/time_series_utils.pyÚ__annotate__ÚAffineTransformed.__annotate__#   s   ø€ ÷ tñ t©,ñ tó    c           	     óž   <€ Vf   RMTV n         Vf   RMTV n        \        SV `  V\	        V P                  V P                   VR7      .4       R # )Ng      ð?ç        ©ÚlocÚscaleÚ	event_dim)r   r   ÚsuperÚ__init__r   )Úselfr   r   r   r   Ú	__class__s   &&&&&€r   r   ÚAffineTransformed.__init__#   sE   ø€ Ø!šM‘S¨uˆŒ
Øš+‘3¨3ˆŒä‰ÑÐ*¬_ÀÇÁÐQU×Q[ÑQ[ÐgpÔ-qÐ,rÖsr   c                ór   € V P                   P                  V P                  ,          V P                  ,           # )z'
Returns the mean of the distribution.
)Ú	base_distÚmeanr   r   ©r   s   &r   r$   ÚAffineTransformed.mean)   s&   € ð
 �~‰~×"Ñ" T§Z¡ZÕ/°$·(±(Õ:Ð:r   c                ó^   € V P                   P                  V P                  ^,          ,          # )z+
Returns the variance of the distribution.
)r#   Úvariancer   r%   s   &r   r(   ÚAffineTransformed.variance0   s!   € ð
 �~‰~×&Ñ&¨¯©°Q­Õ6Ð6r   c                ó6   € V P                   P                  4       # )z5
Returns the standard deviation of the distribution.
)r(   Úsqrtr%   s   &r   ÚstddevÚAffineTransformed.stddev7   s   € ð
 �}‰}×!Ñ!Ó#Ð#r   )r   r   )NNé    )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   Úpropertyr$   r(   r,   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©r    r   s   @@r   r   r   "   sR   ù‡ € ÷tõ tð ñ;ó ð;ð ñ7ó ð7ð ñ$ó ÷$ð $r   r   c                   óP   a a€ ] tR t^?t oV3R lV 3R lltV3R lR ltRtVtV ;t# )ÚParameterProjectionc          	      ó~   <€ V ^8„  d   QhRS[ RS[S[S[ 3,          RS[RS[S[P                  ,          3,          RR/# )r   Úin_featuresÚargs_dimÚ
domain_map.ÚreturnN)ÚintÚdictÚstrr   ÚtupleÚtorchÚTensor)r   r   s   "€r   r   Ú ParameterProjection.__annotate__@   sL   ø€ ÷ %ñ %Ùð%Ù*.©s±C¨x­.ð%ÙFNÈsÑTYÑZ_×ZfÑZfÕTgÐOgÕFhð%à	ñ%r   c           	     óä   <€ \         SV `  ! R/ VB  W n        \        P                  ! VP                  4        Uu. uF  p\        P                  ! W4      NK  	  up4      V n        W0n        R # u upi )N© )	r   r   r<   r   Ú
ModuleListÚvaluesÚLinearÚprojr=   )r   r;   r<   r=   ÚkwargsÚdimr    s   &&&&, €r   r   ÚParameterProjection.__init__@   sV   ø€ ô 	‰ÒÑ"˜6Ò"Ø ŒÜ—M’MÈ(Ï/É/ÔJ[Ó"\ÑJ[À3¤2§9¢9¨[Ö#>ÑJ[Ñ"\Ó]ˆŒ	Ø$Žùò #]s   ºA-c                ó^   <€ V ^8„  d   QhRS[ P                  RS[S[ P                  ,          /# ©r   Úxr>   )rC   rD   rB   )r   r   s   "€r   r   rE   H   s(   ø€ ÷ 2ñ 2™Ÿ™ð 2©%±·±Õ*=ñ 2r   c                ól   € V P                    Uu. uF
  q"! V4      NK  	  ppV P                  ! V!  # u upi ©N)rK   r=   )r   rQ   rK   Úparams_unboundeds   &&  r   ÚforwardÚParameterProjection.forwardH   s4   € Ø04·	²	Ó:±	¨˜D žG±	ÐÐ:à�ŠÐ 0Ñ1Ð1ùò ;s   �1)r<   r=   rK   ©	r/   r0   r1   r2   r   rU   r4   r5   r6   r7   s   @@r   r9   r9   ?   s   ù‡ € ÷%ó %÷2÷ 2ð 2r   r9   c                   ó8   a a€ ] tR t^Nt oV 3R ltR tRtVtV ;t# )ÚLambdaLayerc                ó0   <€ \         SV `  4        Wn        R # rS   )r   r   Úfunction)r   r[   r    s   &&€r   r   ÚLambdaLayer.__init__O   s   ø€ Ü‰ÑÔØ Žr   c                ó*   € V P                   ! V.VO5!  # rS   ©r[   )r   rQ   Úargss   &&*r   rU   ÚLambdaLayer.forwardS   s   € Ø�}Š}˜QÐ& Ó&Ð&r   r^   rW   r7   s   @@r   rY   rY   N   s   ù‡ € õ!÷'ò 'r   rY   c                   óò   a € ] tR t^Wt o RV 3R lR lltR tRV 3R lR llt]V 3R lR l4       t]V 3R	 lR
 l4       t	]V 3R lR l4       t
V 3R lR ltV 3R lR lt]V 3R lR l4       tV 3R ltRtV tR# )ÚDistributionOutputc                ó$   <€ V ^8„  d   QhRS[ RR/# )r   rM   r>   N©r?   )r   r   s   "€r   r   ÚDistributionOutput.__annotate__\   s   ø€ ÷ Kñ K™Cð K¨ñ Kr   c                óŒ   € Wn         V P                   Uu/ uF  q"WP                  V,          ,          bK  	  upV n        R # u upi rS   )rM   r<   )r   rM   Úks   && r   r   ÚDistributionOutput.__init__\   s3   € ØŒØ<@¿MºMÓJ¹M°q˜C§-¡-°Õ"2Õ2Ò2¹MÑJˆŽùÒJs   •"Ac                óx   € V P                   ^8X  d   V P                  ! V!  # \        V P                  ! V!  ^4      # ©é   ©rM   Údistribution_classr   )r   Ú
distr_argss   &&r   Ú_base_distributionÚ%DistributionOutput._base_distribution`   s6   € Ø�8‰8�qŒ=Ø×*Ò*¨JÑ7Ð7ä˜t×6Ò6¸
ÑCÀQÓGÐGr   Nc                óp   <€ V ^8„  d   QhRS[ P                  R,          RS[ P                  R,          RS[/# ©r   r   Nr   r>   ©rC   rD   r   )r   r   s   "€r   r   re   f   sB   ø€ ÷ 
\ñ 
\ñ �\‰\˜DÕ ð
\ñ �|‰|˜dÕ"ð	
\ñ
 
ñ
\r   c                óf   € V P                  V4      pVf   Vf   V# \        WBW0P                  R7      # )Nr   )ro   r   r   )r   rn   r   r   Údistrs   &&&& r   ÚdistributionÚDistributionOutput.distributionf   s3   € ð ×'Ñ'¨
Ó3ˆØŠ;˜5š=ØˆLä$ U¸5ÏNÉNÔ[Ð[r   c                ó    <€ V ^8„  d   QhRS[ /# ©r   r>   )rB   )r   r   s   "€r   r   re   s   s   ø€ ÷ 4ñ 4™Uñ 4r   c                óB   € V P                   ^8X  d   R# V P                   3# )z_
Shape of each individual event contemplated by the distributions that this object constructs.
rG   )rM   r%   s   &r   Úevent_shapeÚDistributionOutput.event_shaper   s   € ð
 —X‘X ”]ˆrÐ3¨¯©¨Ð3r   c                ó    <€ V ^8„  d   QhRS[ /# ry   rd   )r   r   s   "€r   r   re   z   s   ø€ ÷ %ñ %™3ñ %r   c                ó,   € \        V P                  4      # )zx
Number of event dimensions, i.e., length of the `event_shape` tuple, of the distributions that this object
constructs.
)Úlenr{   r%   s   &r   r   ÚDistributionOutput.event_dimy   s   € ô �4×#Ñ#Ó$Ð$r   c                ó    <€ V ^8„  d   QhRS[ /# ry   )Úfloat)r   r   s   "€r   r   re   ‚   s   ø€ ÷ ñ ¡%ñ r   c                ó   € R# )z¯
A float that will have a valid numeric value when computing the log-loss of the corresponding distribution. By
default 0.0. This value will be used when padding data series.
r   rG   r%   s   &r   Úvalue_in_supportÚ#DistributionOutput.value_in_support�   s   € ñ r   c                ó:   <€ V ^8„  d   QhRS[ RS[P                  /# )r   r;   r>   )r?   r   ÚModule)r   r   s   "€r   r   re   ‰   s   ø€ ÷ 
ñ 
±Cð 
¹B¿I¹Iñ 
r   c                óX   € \        VV P                  \        V P                  4      R7      # )zn
Return the parameter projection layer that maps the input to the appropriate parameters of the distribution.
)r;   r<   r=   )r9   r<   rY   r=   )r   r;   s   &&r   Úget_parameter_projectionÚ+DistributionOutput.get_parameter_projection‰   s'   € ô #Ø#Ø—]‘]Ü" 4§?¡?Ó3ô
ð 	
r   c                ó4   <€ V ^8„  d   QhRS[ P                  /# )r   r_   ©rC   rD   )r   r   s   "€r   r   re   “   s   ø€ ÷ $ñ $¡§¡ñ $r   c                ó   € \        4       h)zþ
Converts arguments to the right shape and domain. The domain depends on the type of distribution, while the
correct shape is obtained by reshaping the trailing axis in such a way that the returned tensors define a
distribution of the right event_shape.
)ÚNotImplementedError)r   r_   s   &*r   r=   ÚDistributionOutput.domain_map“   s   € ô "Ó#Ð#r   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# rP   rŒ   )r   r   s   "€r   r   re   œ   s#   ø€ ÷ =ñ =‘e—l‘lð =¡u§|¡|ñ =r   c                ó€   € V \         P                  ! \         P                  ! V 4      R,           4      ,           R,          # )zš
Helper to map inputs to the positive orthant by applying the square-plus operation. Reference:
https://twitter.com/jon_barron/status/1387167648669048833
g      @ç       @)rC   r+   Úsquare)rQ   s   &r   Ú
squareplusÚDistributionOutput.squareplus›   s*   € ð ”E—J’JœuŸ|š|¨A›°Õ4Ó5Õ5¸Õ<Ð<r   c                óT   <€ V ^8„  d   Qh/ S[ ;R&   S[;R&   S[S[S[3,          ;R&   # )r   rm   r;   r<   )Útyper?   r@   rA   )r   r   s   "€r   r   re   W   s0   ø‡ ‚ ÙÑñ áÑñ ñ ‘3™�8�nÑò r   )r<   rM   rj   ©NN)r/   r0   r1   r2   r   ro   rv   r3   r{   r   r„   r‰   r=   Ústaticmethodr”   Ú__annotate_func__r4   r5   ©r   s   @r   rb   rb   W   s�   ø‡ € ÷
Kò KòH÷
\ò 
\ð ÷4ó ð4ð ÷%ó ð%ð ÷ó ð÷
ð 
÷$ð $ð ÷=ó ð=÷K ƒ r   rb   c                   ó`   a € ] tR t^¤t o RtR^R^R^/t]t]V 3R lR l4       t	V 3R lt
RtV tR	# )
ÚStudentTOutputz&
Student-T distribution output class.
Údfr   r   c                óh   <€ V ^8„  d   QhRS[ P                  RS[ P                  RS[ P                  /# )r   rž   r   r   rŒ   )r   r   s   "€r   r   ÚStudentTOutput.__annotate__­   s3   ø€ ÷ Bñ B™EŸL™Lð B©u¯|©|ð BÁEÇLÁLñ Br   c                ó&  € V P                  V4      P                  \        P                  ! VP                  4      P
                  4      pR V P                  V4      ,           pVP                  R4      VP                  R4      VP                  R4      3# )r’   éÿÿÿÿ©r”   Ú	clamp_minrC   ÚfinfoÚdtypeÚepsÚsqueeze)Úclsrž   r   r   s   &&&&r   r=   ÚStudentTOutput.domain_map¬   sg   € à—‘˜uÓ%×/Ñ/´·²¸E¿K¹KÓ0H×0LÑ0LÓMˆØ�3—>‘> "Ó%Õ%ˆØ�z‰z˜"‹~˜sŸ{™{¨2›°·±¸bÓ0AÐAÐAr   c                óH   <€ V ^8„  d   Qh/ S[ S[S[3,          ;R&   S[;R&   # ©r   r<   rm   ©r@   rA   r?   r—   )r   r   s   "€r   r   r    ¤   s'   ø‡ ‚ ñ
 ‘3™�8�nÑ>ñ ñ Ñ'ò r   rG   N)r/   r0   r1   r2   Ú__doc__r<   r	   rm   Úclassmethodr=   rš   r4   r5   r›   s   @r   r�   r�   ¤   s?   ø‡ € ñð !% a¨°°7¸AÐ>€HØ'Ðà÷Bó ðB÷ ƒ r   r�   c                   ó\   a € ] tR t^³t o RtR^R^/t]t]V 3R lR l4       t	V 3R lt
RtV tR# )	ÚNormalOutputz#
Normal distribution output class.
r   r   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# )r   r   r   rŒ   )r   r   s   "€r   r   ÚNormalOutput.__annotate__¼   s#   ø€ ÷ 2ñ 2™UŸ\™\ð 2±%·,±,ñ 2r   c                óÖ   € V P                  V4      P                  \        P                  ! VP                  4      P
                  4      pVP                  R4      VP                  R4      3# ©rk   r¢   r£   )r©   r   r   s   &&&r   r=   ÚNormalOutput.domain_map»   sJ   € à—‘˜uÓ%×/Ñ/´·²¸E¿K¹KÓ0H×0LÑ0LÓMˆØ�{‰{˜2‹ §¡¨bÓ 1Ð1Ð1r   c                óH   <€ V ^8„  d   Qh/ S[ S[S[3,          ;R&   S[;R&   # r¬   r­   )r   r   s   "€r   r   r³   ³   s'   ø‡ ‚ ñ
 ‘3™�8�nÑ5ñ ñ Ñ%ò r   rG   N)r/   r0   r1   r2   r®   r<   r   rm   r¯   r=   rš   r4   r5   r›   s   @r   r±   r±   ³   s9   ø‡ € ñð !& q¨'°1Ð5€HØ%Ðà÷2ó ð2÷ ƒ r   r±   c                   ó„   a € ] tR t^Át o RtR^R^/t]t]V 3R lR l4       t	V 3R lR lt
RV 3R	 lR
 lltV 3R ltRtV tR# )ÚNegativeBinomialOutputz.
Negative Binomial distribution output class.
Útotal_countÚlogitsc                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# )r   rº   r»   rŒ   )r   r   s   "€r   r   Ú#NegativeBinomialOutput.__annotate__Ê   s#   ø€ ÷ ;ñ ;¡U§\¡\ð ;¹5¿<¹<ñ ;r   c                óh   € V P                  V4      pVP                  R4      VP                  R4      3# rµ   )r”   r¨   )r©   rº   r»   s   &&&r   r=   Ú!NegativeBinomialOutput.domain_mapÉ   s/   € à—n‘n [Ó1ˆØ×"Ñ" 2Ó&¨¯©°rÓ(:Ð:Ð:r   c                ó    <€ V ^8„  d   QhRS[ /# ry   r   )r   r   s   "€r   r   r½   Î   s   ø€ ÷ cñ c±ñ cr   c                óˆ   € Vw  r#V P                   ^8X  d   V P                  W#R7      # \        V P                  W#R7      ^4      # )rk   )rº   r»   rl   )r   rn   rº   r»   s   &&  r   ro   Ú)NegativeBinomialOutput._base_distributionÎ   sE   € Ø(ÑˆØ�8‰8�qŒ=Ø×*Ñ*°{Ð*ÓRÐRä˜t×6Ñ6À;Ð6Ó^Ð`aÓbÐbr   Nc                óp   <€ V ^8„  d   QhRS[ P                  R,          RS[ P                  R,          RS[/# rr   rs   )r   r   s   "€r   r   r½   Ø   s8   ø€ ÷ 	>ñ 	>Ù$Ÿ|™|¨dÕ2ð	>ÙBGÇ,Á,ÐQUÕBUð	>á	ñ	>r   c                ób   € Vw  rEVe   WSP                  4       ,          pV P                  WE34      # rS   )Úlogro   )r   rn   r   r   rº   r»   s   &&&&  r   rv   Ú#NegativeBinomialOutput.distributionØ   s4   € ð )ÑˆàÒà—i‘i“kÕ!ˆFà×&Ñ&¨Ð'<Ó=Ð=r   c                óH   <€ V ^8„  d   Qh/ S[ S[S[3,          ;R&   S[;R&   # r¬   r­   )r   r   s   "€r   r   r½   Á   s'   ø‡ ‚ ñ
 ‘3™�8�nÑ>ñ ñ Ñ/ò r   rG   r˜   )r/   r0   r1   r2   r®   r<   r   rm   r¯   r=   ro   rv   rš   r4   r5   r›   s   @r   r¹   r¹   Á   sO   ø‡ € ñð !.¨q°(¸AÐ>€HØ/Ðà÷;ó ð;÷cð c÷	>ò 	>÷/ ƒ r   r¹   )r®   Úcollections.abcr   rC   r   Útorch.distributionsr   r   r   r   r   r	   r
   r   r‡   r9   rY   rb   r�   r±   r¹   rG   r   r   Ú<module>rÊ      s‡   ðñõ %ã Ý ÷÷ ñ ô$Ð/ô $ô:2˜"Ÿ)™)ô 2ô'�"—)‘)ô '÷J=ñ J=ôZBÐ'ô Bô2Ð%ô 2ô >Ð/ö  >r   