+
    NV-jÖ?  ã                   óP	  € ^ RI t ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 R t
]! ]P                  RR7      R 4       t]! ]P                  RR7      R	 4       t]! ]P                  RR7      R
 4       t]! ]P                  RR7      R 4       t]! ]P                  RR7      R[R l4       t]! ]P                  RR7      R\R l4       t]! ]P                  RR7      R]R l4       t]! ]P                  RR7      R\R l4       t]! ]P                  RR7      R 4       t]! ]P                  RR7      R 4       t]! ]P                  RR7      R^R R ll4       t]! ]P                  RR7      R]R l4       t]! ]P                  RR7      R 4       t]! ]P                  RR7      R 4       t]! ]P                  RR7      R R l4       t]! ]P                  RR7      R 4       t]! ]P                  RR7      R 4       tR\R R llt]! ]P                  RR7      R_R R ll4       t]! ]P                  RR7      R 4       t]! ]P                  RR7      R  R! l4       t ]! ]P                  RR7      R" R# l4       t!]! ]P                  RR7      R$ 4       t"]! ]P                  RR7      R`R% l4       t#]! ]P                  RR7      R^R& l4       t$]! ]P                  RR7      R\R' l4       t%R( t& ! R) R*]	4      t']
! ]4       ! R+ R,]	4      4       t(]
! ]!4       ! R- R.]	4      4       t)]
! ]4       ! R/ R0]	4      4       t*]
! ]4       ! R1 R2]	4      4       t+]
! ]4       ! R3 R4]	4      4       t, ! R5 R6]	4      t- ! R7 R8]	4      t.]
! ]4       ! R9 R:]	4      4       t/]
! ]4       ! R; R<]	4      4       t0]
! ]4       ! R= R>]	4      4       t1 ! R? R@]	4      t2 ! RA RB]	4      t3]
! ]4       ! RC RD]	4      4       t4]
! ]4       ! RE RF]	4      4       t5]
! ]4       ! RG RH]	4      4       t6 ! RI RJ]	4      t7 ! RK RL]	4      t8]
! ]&4       ! RM RN]	4      4       t9]
! ]"4       ! RO RP]	4      4       t: ! RQ RR]	4      t;]
! ]4       ! RS RT]	4      4       t<]
! ]#4       ! RU RV]	4      4       t=]
! ]$4       ! RW RX]	4      4       t>]
! ]%4       ! RY RZ]	4      4       t?R# )aé    N)Úpartial©ÚAny)ÚModulec                 ó   a € V 3R  lpV# )c                 ó   <€ V3R  lV n         V # )c                 ó   <€ S! V4      # ©N© )Ú_ÚxÚfs   &&€Új/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/mlx/nn/layers/activations.pyÚ<lambda>Ú<_make_activation_module.<locals>.decorator.<locals>.<lambda>   s	   ø€ ¡a¨¤dó    )Ú__call__)Úklassr   s   &€r   Ú	decoratorÚ*_make_activation_module.<locals>.decorator   s   ø€ Ü*ˆŒØˆr   r   )r   r   s   f r   Ú_make_activation_moduler      s   ø€ õð Ðr   T)Ú	shapelessc                ó.   € \         P                  ! V 4      # )zdApplies the sigmoid function.

.. math::
    \text{Sigmoid}(x) = \sigma(x) = \frac{1}{1 + \exp(-x)}
©ÚmxÚsigmoid©r   s   &r   r   r      s   € ô �:Š:�a‹=Ðr   c                ó0   € \         P                  ! V ^ 4      # )zAApplies the Rectified Linear Unit.

Simply ``mx.maximum(x, 0)``.
©r   Úmaximumr   s   &r   Úrelur!      s   € ô �:Š:�a˜ÓÐr   c                óX   € \         P                  ! \         P                  ! V ^ 4      4      # )uT   Applies the ReLUÂ² activation function.

Applies :math:`\max(0, x)^2` element wise.
)r   Úsquarer    r   s   &r   Úrelu2r$   &   s   € ô �9Š9”R—Z’Z  1Ó%Ó&Ð&r   c                óZ   € \         P                  ! \         P                  ! V ^ 4      R4      # )zXApplies the Rectified Linear Unit 6.

Applies :math:`\min(\max(x, 0), 6)` element wise.
g      @©r   Úminimumr    r   s   &r   Úrelu6r(   /   s    € ô �:Š:”b—j’j  AÓ&¨Ó,Ð,r   c                ó<   € \         P                  ! W,          V 4      # )zXApplies the Leaky Rectified Linear Unit.

Simply ``mx.maximum(negative_slope * x, x)``.
r   )r   Únegative_slopes   &&r   Ú
leaky_relur+   8   s   € ô �:Š:�nÕ(¨!Ó,Ð,r   c                ó@   € V \         P                  ! WRR7      ,
          # )zYApplies the Log Softmax function.

Applies :math:`x + \log \sum_i e^{x_i}` element wise.
T)ÚaxisÚkeepdims)r   Ú	logsumexp©r   r-   s   &&r   Úlog_softmaxr1   A   s   € ð Œr�|Š|˜A°4Ô8Õ8Ð8r   c                óz   € \         P                  ! V ^ 8„  W\         P                  ! V 4      ^,
          ,          4      # )z^Applies the Exponential Linear Unit.

Simply ``mx.where(x > 0, x, alpha * (mx.exp(x) - 1))``.
)r   ÚwhereÚexp©r   Úalphas   &&r   Úelur7   J   s*   € ô �8Š8�A˜‘E˜1¤r§v¢v¨a£y°1¥}Õ5Ó6Ð6r   c                ó0   € \         P                  ! WR7      # )z\Applies the Softmax function.

Applies :math:`\frac{e^{x_i}}{\sum_j e^{x_j}}` element wise.
©r-   ©r   Úsoftmaxr0   s   &&r   r;   r;   S   s   € ô �:Š:�aÔ#Ð#r   c                ó0   € \         P                  ! V ^ 4      # )zPApplies the Softplus function.

Applies :math:`\log(1 + \exp(x))` element wise.
)r   Ú	logaddexpr   s   &r   Úsoftplusr>   \   s   € ô �<Š<˜˜1ÓÐr   c                óf   € \         P                  ! V ^\         P                  ! V 4      ,           4      # )zPApplies the Softsign function.

Applies :math:`\frac{x}{1 + |x|}` element wise.
)r   ÚdivideÚabsr   s   &r   ÚsoftsignrB   e   s!   € ô �9Š9�Q˜œBŸFšF 1›I�Ó&Ð&r   c                ó$   € V ^8„  d   QhR\         /# )é   Úlambd©Úfloat)Úformats   "r   Ú__annotate__rI   o   s   € ÷ 
Bñ 
Bœñ 
Br   c                ó¤   € \         P                  ! \         P                  ! V 4      V8„  V \         P                  ! V 4      V,          ,
          ^ 4      # )zâApplies the Softshrink activation function.

.. math::
    \text{softshrink}(x) = \begin{cases}
    x - \lambda & \text{if } x > \lambda \\
    x + \lambda & \text{if } x < -\lambda \\
    0 & \text{otherwise}
    \end{cases}
)r   r3   rA   Úsign©r   rE   s   &&r   Ú
softshrinkrM   n   s6   € ô �8Š8”B—F’F˜1“I Ñ% q¬2¯7ª7°1«:¸Õ+=Õ'=¸qÓAÐAr   c                óº   € \         P                  ! V R4      V\         P                  ! \         P                  ! V R4      V,          4      ^,
          ,          ,           # )z–Applies the Continuously Differentiable Exponential Linear Unit.

Applies :math:`\max(0, x) + \min(0, \alpha * (\exp(x / \alpha) - 1))`
element wise.
ç        )r   r    r4   r'   r5   s   &&r   ÚcelurP   |   s=   € ô �:Š:�a˜Ó ¬¯ª´·
²
¸1¸cÓ0BÀUÕ0JÓ)KÈaÕ)OÕ PÕPÐPr   c                ó<   € V \         P                  ! V 4      ,          # )z–Applies the Sigmoid Linear Unit. Also known as Swish.

Applies :math:`x \sigma(x)` element wise, where :math:`\sigma(\cdot)` is
the logistic sigmoid.
r   r   s   &r   ÚsilurR   †   s   € ð Œr�zŠz˜!‹}ÕÐr   c                ó   € \        V ) 4      ) # )zeApplies the Log Sigmoid function.

Applies :math:`\log(\sigma(x)) = -\log(1 + e^{-x})` element wise.
)r>   r   s   &r   Úlog_sigmoidrT   �   s   € ô �a�R‹Lˆ=Ðr   c                ó8   € V ^8„  d   QhR\         P                  /# ©rD   Úreturn©r   Úarray)rH   s   "r   rI   rI   š   s   € ÷ 2ñ 2Œr�x‰xñ 2r   c                óŽ   € V ^\         P                  ! V \        P                  ! ^4      ,          4      ,           ,          ^,          # )zâApplies the Gaussian Error Linear Units function.

.. math::
    \textrm{GELU}(x) = x * \Phi(x)

where :math:`\Phi(x)` is the Gaussian CDF.

See also :func:`gelu_approx` and :func:`gelu_fast_approx` for faster
approximations.
)r   ÚerfÚmathÚsqrtr   s   &r   Úgelur^   ™   s/   € ð �”B—F’F˜1œtŸyšy¨›|Õ+Ó,Õ,Õ-°Õ1Ð1r   c           	     óâ   € RV ,          ^\         P                  ! \        P                  ! ^\        P                  ,          4      V RV ^,          ,          ,           ,          4      ,           ,          # )a\  An approximation to Gaussian Error Linear Unit.

See :func:`gelu` for the exact computation.

This function approximates ``gelu`` with a maximum absolute error :math:`<
0.0005` in the range :math:`[-6, 6]` using the following

.. math::

    x = 0.5 * x * \left(1 + \text{Tanh}\left((\sqrt{2 / \pi} * \left(x + 0.044715 * x^3\right)\right)\right)

ç      à?g÷Hmâä¦?)r   Útanhr\   r]   Úpir   s   &r   Úgelu_approxrc   ¨   sD   € ð ��7�aœ"Ÿ'š'¤$§)¢)¨A´·±­KÓ"8¸AÀÈ1ÈaÍ4ÅÕ<OÕ"PÓQÕQÕRÐRr   c                óJ   € V \         P                  ! RV ,          4      ,          # )a¡  A fast approximation to Gaussian Error Linear Unit.

See :func:`gelu` for the exact computation.

This function approximates ``gelu`` with a maximum absolute error :math:`<
0.015` in the range :math:`[-6, 6]` using the following

.. math::

    x = x \sigma\left(1.702 x\right)

where :math:`\sigma(\cdot)` is the logistic sigmoid.

References:
- https://github.com/hendrycks/GELUs
- https://arxiv.org/abs/1606.08415
g¬Zd;û?r   r   s   &r   Úgelu_fast_approxre   ¹   s   € ð& Œr�zŠz˜% !�)Ó$Õ$Ð$r   c                ód   € V ^8„  d   QhR\         P                  R\        R\         P                  /# )rD   r   r-   rW   )r   rY   Úint)rH   s   "r   rI   rI   Ï   s)   € ÷ ñ Œ2�8‰8ð œ3ð ¬¯©ñ r   c                ór   € \         P                  ! V ^VR7      w  r#V\         P                  ! V4      ,          # )á#  Applies the gated linear unit function.

This function splits the ``axis`` dimension of the input into two halves
(:math:`a` and :math:`b`) and applies :math:`a * \sigma(b)`.

.. math::
    \textrm{GLU}(x) = a * \sigma(b)

Args:
    axis (int): The dimension to split along. Default: ``-1``
)Úindices_or_sectionsr-   )r   Úsplitr   )r   r-   ÚaÚbs   &&  r   Úglurn   Ï   s+   € ô �8Š8�A¨1°4Ô8�D€AØŒr�zŠz˜!‹}ÕÐr   c                óD   € V ^8„  d   QhR\         P                  R\        /# )rD   r   Ú	threshold)r   rY   rG   )rH   s   "r   rI   rI   à   s   € ÷ )ñ )ŒB�H‰Hð )¤ñ )r   c                ó6   € \         P                  ! W8„  ^^ 4      # )á�  Applies the Step Activation Function.

This function implements a binary step activation, where the output is set
to 1 if the input is greater than a specified threshold, and 0 otherwise.

.. math::
    \text{step}(x) = \begin{cases}
    0 & \text{if } x < \text{threshold} \\
    1 & \text{if } x \geq \text{threshold}
    \end{cases}

Args:
    threshold: The value to threshold at.
)r   r3   )r   rp   s   &&r   Ústeprs   ß   s   € ô" �8Š8�A‘M 1 aÓ(Ð(r   c                ó(   € \        V R4      R,          # )a  Applies the Scaled Exponential Linear Unit.

.. math::
    \text{selu}(x) = \begin{cases}
    \lambda x & \text{if } x > 0 \\
    \lambda \alpha (\exp(x) - 1) & \text{if } x \leq 0
    \end{cases}

where :math:`\lambda = 1.0507` and :math:`\alpha = 1.67326`.

See also :func:`elu`.
g„GG¬Åú?gäƒžÍªÏð?)r7   r   s   &r   Úseluru   ó   s   € ô ˆq�'‹?˜VÕ#Ð#r   c                óx   € V ^8„  d   QhR\         P                  R\         P                  R\         P                  /# )rD   r   r6   rW   rX   )rH   s   "r   rI   rI     s-   € ÷ 7ñ 7ŒR�X‰Xð 7œbŸh™hð 7¬2¯8©8ñ 7r   c                óv   € \         P                  ! ^ V 4      V\         P                  ! ^ V 4      ,          ,           # )zƒApplies the element-wise parametric ReLU.

.. math::
    \text{PReLU}(x) = \max(0,x) + a * \min(0,x)

where :math:`a` is an array.
©r   r    r'   r5   s   &&r   Úprelury     s*   € ô �:Š:�a˜Ó˜e¤b§j¢j°°AÓ&6Õ6Õ6Ð6r   c                óX   € V ^8„  d   QhR\         P                  R\         P                  /# )rD   r   rW   rX   )rH   s   "r   rI   rI     s"   € ÷ $ñ $ŒB�H‰Hð $œŸ™ñ $r   c                óN   € V \         P                  ! \        V 4      4      ,          # )zßApplies the Mish function, element-wise.

Mish: A Self Regularized Non-Monotonic Neural Activation Function.

Reference: https://arxiv.org/abs/1908.08681

.. math::
    \text{Mish}(x) = x * \text{Tanh}(\text{Softplus}(x))

)r   ra   r>   r   s   &r   Úmishr|     s   € ð Œr�wŠw”x “{Ó#Õ#Ð#r   c                óˆ   € \         P                  ! V ^,           ^ 4      pV \         P                  ! V^4      ,          ^,          # )zsApplies the hardswish function, element-wise.

.. math::
    \text{Hardswish}(x) = x * \min(\max(x + 3, 0), 6) / 6
rx   )r   Úmax_x_3s   & r   Ú	hardswishr     s3   € ô �jŠj˜˜Q� Ó"€GØŒr�zŠz˜' 1Ó%Õ%¨Õ)Ð)r   c                óX   € \         P                  ! \         P                  ! W4      V4      # )zrApplies the HardTanh function.

Applies :math:`\max(\min(x, \mathrm{max\_val}), \mathrm{min\_val})` element-wise.
r&   )r   Úmin_valÚmax_vals   &&&r   Ú	hard_tanhrƒ   *  s   € ô �:Š:”b—j’j Ó,¨gÓ6Ð6r   c                ó`   € \         P                  ! \         P                  ! V 4      V8„  V ^ 4      # )zÎApplies the HardShrink activation function.

.. math::
    \text{hardshrink}(x) = \begin{cases}
    x & \text{if } x > \lambda \\
    x & \text{if } x < -\lambda \\
    0 & \text{otherwise}
    \end{cases}
)r   r3   rA   rL   s   &&r   Úhard_shrinkr…   3  s$   € ô �8Š8”B—F’F˜1“I Ñ% q¨!Ó,Ð,r   c                ó4   € \         P                  ! V ) VR7      # )z^Applies the Softmin function.

Applies :math:`\frac{e^{-x_i}}{\sum_j e^{-x_j}}` element-wise.
r9   r:   r0   s   &&r   Úsoftminr‡   A  s   € ô �:Š:�q�b˜tÔ$Ð$r   c                ó.   € \         P                  ! V 4      # )zAApplies the hyperbolic tangent function.

Simply ``mx.tanh(x)``.
)r   ra   r   s   &r   ra   ra   J  s   € ô
 �7Š7�1‹:Ðr   c                   óX   a a€ ] tR tRt oRtRV3R lV 3R llltV3R lR ltRtVtV ;t	# )	ÚGLUiR  ri   c                ó    <€ V ^8„  d   QhRS[ /# )rD   r-   )rg   )rH   Ú__classdict__s   "€r   rI   ÚGLU.__annotate___  s   ø€ ÷ ñ ™Sñ r   c                ó0   <€ \         SV `  4        Wn        R # r
   )ÚsuperÚ__init__r-   )Úselfr-   Ú	__class__s   &&€r   r�   ÚGLU.__init___  s   ø€ Ü‰ÑÔØŽ	r   c                ó    <€ V ^8„  d   QhRS[ /# rV   r   )rH   rŒ   s   "€r   rI   r�   c  s   ø€ ÷ (ñ (™Sñ (r   c                ó.   € \        WP                  R 7      # )r0   )rn   r-   ©r‘   r   s   &&r   r   ÚGLU.__call__c  s   € Ü�QŸY™YÔ'Ð'r   r9   ©éÿÿÿÿ©
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r�   r   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©r’   rŒ   s   @@r   rŠ   rŠ   R  s#   ù‡ € ñ
÷õ ÷(÷ (ð (r   rŠ   c                   ó   € ] tR tRtRtRtR# )ÚSigmoidig  zrApplies the sigmoid function, element-wise.

.. math::
    \text{Sigmoid}(x) = \sigma(x) = \frac{1}{1 + \exp(-x)}
r   N©r›   rœ   r�   rž   rŸ   r    r   r   r   r¥   r¥   g  ó   † õr   r¥   c                   ó   € ] tR tRtRtRtR# )ÚMiship  z›Applies the Mish function, element-wise.

Reference: https://arxiv.org/abs/1908.08681

.. math::
    \text{Mish}(x) = x * \text{Tanh}(\text{Softplus}(x))

r   Nr¦   r   r   r   r©   r©   p  s   † õr   r©   c                   ó   € ] tR tRtRtRtR# )ÚReLUi|  zuApplies the Rectified Linear Unit.
    Simply ``mx.maximum(x, 0)``.

See :func:`relu` for the functional equivalent.
r   Nr¦   r   r   r   r«   r«   |  r§   r   r«   c                   ó   € ] tR tRtRtRtR# )ÚReLU2i…  uZ   Applies the ReLUÂ² activation function.

See :func:`relu2` for the functional equivalent.
r   Nr¦   r   r   r   r­   r­   …  ó   † õr   r­   c                   ó   € ] tR tRtRtRtR# )ÚReLU6i�  zWApplies the Rectified Linear Unit 6.

See :func:`relu6` for the functional equivalent.
r   Nr¦   r   r   r   r°   r°   �  r®   r   r°   c                   ó@   a a€ ] tR tRt oRtRV 3R lltR tRtVtV ;t	# )Ú	LeakyReLUi•  z¯Applies the Leaky Rectified Linear Unit.

Simply ``mx.maximum(negative_slope * x, x)``.

Args:
    negative_slope: Controls the angle of the negative slope. Default: ``1e-2``
c                ó0   <€ \         SV `  4        Wn        R # r
   )r�   r�   Ú_negative_slope)r‘   r*   r’   s   &&€r   r�   ÚLeakyReLU.__init__ž  s   ø€ Ü‰ÑÔØ-Ör   c                ó,   € \        WP                  4      # r
   )r+   r´   r–   s   &&r   r   ÚLeakyReLU.__call__¢  s   € Ü˜!×1Ñ1Ó2Ð2r   )r´   ©g{®Gáz„?rš   r£   s   @@r   r²   r²   •  s   ù‡ € ñ÷.÷3ò 3r   r²   c                   ó@   a a€ ] tR tRt oRtRV 3R lltR tRtVtV ;t	# )ÚELUi¦  zæApplies the Exponential Linear Unit.
    Simply ``mx.where(x > 0, x, alpha * (mx.exp(x) - 1))``.

See :func:`elu` for the functional equivalent.

Args:
    alpha: the :math:`\alpha` value for the ELU formulation. Default: ``1.0``
c                ó0   <€ \         SV `  4        Wn        R # r
   ©r�   r�   Ú_alpha©r‘   r6   r’   s   &&€r   r�   ÚELU.__init__°  ó   ø€ Ü‰ÑÔØŽr   c                ó,   € \        WP                  4      # r
   )r7   r½   r–   s   &&r   r   ÚELU.__call__´  s   € Ü�1—k‘kÓ"Ð"r   ©r½   ©ç      ð?rš   r£   s   @@r   rº   rº   ¦  s   ù‡ € ñ÷÷#ò #r   rº   c                   ó   € ] tR tRtRtRtR# )ÚSoftmaxi¸  zRApplies the Softmax function.

See :func:`softmax` for the functional equivalent.
r   Nr¦   r   r   r   rÇ   rÇ   ¸  r®   r   rÇ   c                   ó   € ] tR tRtRtRtR# )ÚSoftplusiÀ  zTApplies the Softplus function.

See :func:`softplus` for the functional equivalent.
r   Nr¦   r   r   r   rÉ   rÉ   À  r®   r   rÉ   c                   ó   € ] tR tRtRtRtR# )ÚSoftsigniÈ  zTApplies the Softsign function.

See :func:`softsign` for the functional equivalent.
r   Nr¦   r   r   r   rË   rË   È  r®   r   rË   c                   ó@   a a€ ] tR tRt oRtRV 3R lltR tRtVtV ;t	# )Ú
SoftshrinkiÐ  z¥Applies the Softshrink function.

See :func:`softshrink` for the functional equivalent.

Args:
    lambd: the :math:`\lambda` value for Softshrink. Default: ``0.5``
c                ó0   <€ \         SV `  4        Wn        R # r
   )r�   r�   rE   )r‘   rE   r’   s   &&€r   r�   ÚSoftshrink.__init__Ù  s   ø€ Ü‰ÑÔØŽ
r   c                ó,   € \        WP                  4      # r
   )rM   rE   r–   s   &&r   r   ÚSoftshrink.__call__Ý  s   € Ü˜!ŸZ™ZÓ(Ð(r   )rE   ©r`   rš   r£   s   @@r   rÍ   rÍ   Ð  s   ù‡ € ñ÷÷)ò )r   rÍ   c                   ó@   a a€ ] tR tRt oRtRV 3R lltR tRtVtV ;t	# )ÚCELUiá  a$  Applies the Continuously Differentiable Exponential Linear Unit.
    Applies :math:`\max(0, x) + \min(0, \alpha * (\exp(x / \alpha) - 1))`
    element wise.

See :func:`celu` for the functional equivalent.

Args:
    alpha: the :math:`\alpha` value for the CELU formulation. Default: ``1.0``
c                ó0   <€ \         SV `  4        Wn        R # r
   r¼   r¾   s   &&€r   r�   ÚCELU.__init__ì  rÀ   r   c                ó,   € \        WP                  4      # r
   )rP   r½   r–   s   &&r   r   ÚCELU.__call__ð  s   € Ü�A—{‘{Ó#Ð#r   rÃ   rÄ   rš   r£   s   @@r   rÔ   rÔ   á  s   ù‡ € ñ÷÷$ò $r   rÔ   c                   ó   € ] tR tRtRtRtR# )ÚSiLUiô  zgApplies the Sigmoid Linear Unit. Also known as Swish.

See :func:`silu` for the functional equivalent.
r   Nr¦   r   r   r   rÚ   rÚ   ô  r®   r   rÚ   c                   ó   € ] tR tRtRtRtR# )Ú
LogSoftmaxiü  zZApplies the Log Softmax function.

See :func:`log_softmax` for the functional equivalent.
r   Nr¦   r   r   r   rÜ   rÜ   ü  r®   r   rÜ   c                   ó   € ] tR tRtRtRtR# )Ú
LogSigmoidi  zZApplies the Log Sigmoid function.

See :func:`log_sigmoid` for the functional equivalent.
r   Nr¦   r   r   r   rÞ   rÞ     r®   r   rÞ   c                   óL   a a€ ] tR tRt oRtRV 3R lltV3R lR ltRtVtV ;t	# )ÚPReLUi  a?  Applies the element-wise parametric ReLU.
    Applies :math:`\max(0, x) + a * \min(0, x)` element wise, where :math:`a`
    is an array.

See :func:`prelu` for the functional equivalent.

Args:
    num_parameters: number of :math:`a` to learn. Default: ``1``
    init: the initial value of :math:`a`. Default: ``0.25``
c                ó^   <€ \         SV `  4        \        P                  ! V.V4      V n        R # r
   )r�   r�   r   ÚfullÚweight)r‘   Únum_parametersÚinitr’   s   &&&€r   r�   ÚPReLU.__init__  s#   ø€ Ü‰ÑÔÜ—g’g˜~Ð.°Ó5ˆŽr   c                ó4   <€ V ^8„  d   QhRS[ P                  /# ©rD   r   rX   )rH   rŒ   s   "€r   rI   ÚPReLU.__annotate__  s   ø€ ÷ %ñ %™"Ÿ(™(ñ %r   c                ó,   € \        WP                  4      # r
   )ry   rã   r–   s   &&r   r   ÚPReLU.__call__  s   € Ü�QŸ™Ó$Ð$r   )rã   )é   g      Ð?rš   r£   s   @@r   rà   rà     s   ù‡ € ñ	÷6÷%÷ %ð %r   rà   c                   ó@   a a€ ] tR tRt oRtRV 3R lltR tRtVtV ;t	# )ÚGELUi   að  Applies the Gaussian Error Linear Units.

.. math::
    \textrm{GELU}(x) = x * \Phi(x)

where :math:`\Phi(x)` is the Gaussian CDF.

However, if ``approx`` is set to 'precise' or 'fast' it applies

.. math::
    \textrm{GELUApprox}(x) &= 0.5 * x * \left(1 + \text{Tanh}\left((\sqrt{2 / \pi} * \left(x + 0.044715 * x^3\right)\right)\right) \\
    \textrm{GELUFast}(x) &= x * \sigma\left(1.702 * x\right)

respectively.

.. note::
   For compatibility with the PyTorch API, 'tanh' can be used as an alias
   for 'precise'.

See :func:`gelu`, :func:`gelu_approx` and :func:`gelu_fast_approx` for the
functional equivalents and information regarding error bounds.


Args:
    approx ('none' | 'precise' | 'fast'): Which approximation to gelu to use if any.
c                óh   <€ \         SV `  4        Wn        . ROpW9  d   \        RV RV R24      hR# )ÚnonezThe approximation should be in z but 'z' was givenN)rð   Úprecisera   Úfast)r�   r�   Ú_approxÚ
ValueError)r‘   ÚapproxÚallowedr’   s   && €r   r�   ÚGELU.__init__<  sB   ø€ Ü‰ÑÔØŒÚ5ˆØÔ ÜØ1°'°¸&ÀÀÈÐTóð ñ !r   c                óˆ   € V P                   R 8X  d   \        V4      # V P                   R9   d   \        V4      # \        V4      # )rð   )rñ   ra   )ró   r^   rc   re   r–   s   &&r   r   ÚGELU.__call__E  s9   € Ø�<‰<˜6Ô!Ü˜“7ˆNØ�\‰\Ð0Ô0Ü˜q“>Ð!Ü Ó"Ð"r   )ró   )rð   rš   r£   s   @@r   rî   rî      s   ù‡ € ñ÷6÷#ò #r   rî   c                   ó   € ] tR tRtRtRtR# )ÚTanhiM  zZApplies the hyperbolic tangent function.

See :func:`tanh` for the functional equivalent.
r   Nr¦   r   r   r   rû   rû   M  r®   r   rû   c                   ó   € ] tR tRtRtRtR# )Ú	HardswishiU  zdApplies the hardswish function, element-wise.

See :func:`hardswish` for the functional equivalent.
r   Nr¦   r   r   r   rý   rý   U  r®   r   rý   c                   óX   a a€ ] tR tRt oRtRV3R lV 3R llltV3R lR ltRtVtV ;t	# )	ÚStepi]  rr   c                ó    <€ V ^8„  d   QhRS[ /# )rD   rp   rF   )rH   rŒ   s   "€r   rI   ÚStep.__annotate__m  s   ø€ ÷ #ñ #¡%ñ #r   c                ó0   <€ \         SV `  4        Wn        R # r
   )r�   r�   rp   )r‘   rp   r’   s   &&€r   r�   ÚStep.__init__m  s   ø€ Ü‰ÑÔØ"Žr   c                ó4   <€ V ^8„  d   QhRS[ P                  /# rè   rX   )rH   rŒ   s   "€r   rI   r  q  s   ø€ ÷ 'ñ '™"Ÿ(™(ñ 'r   c                ó,   € \        WP                  4      # r
   )rs   rp   r–   s   &&r   r   ÚStep.__call__q  s   € Ü�A—~‘~Ó&Ð&r   )rp   ©rO   rš   r£   s   @@r   rÿ   rÿ   ]  s#   ù‡ € ñ÷#õ #÷'÷ 'ð 'r   rÿ   c                   ó   € ] tR tRtRtRtR# )ÚSELUiu  z]Applies the Scaled Exponential Linear Unit.

See :func:`selu` for the functional equivalent.
r   Nr¦   r   r   r   r	  r	  u  r®   r   r	  c                   ó   € ] tR tRtRtRtR# )ÚHardTanhi}  zUApplies the HardTanh function.

See :func:`hard_tanh` for the functional equivalent.
r   Nr¦   r   r   r   r  r  }  r®   r   r  c                   ó   € ] tR tRtRtRtR# )Ú
HardShrinki…  z¦Applies the HardShrink function.

See :func:`hard_shrink` for the functional equivalent.

Args:
    lambd: the :math:`\lambda` value for Hardshrink. Default: ``0.5``
r   Nr¦   r   r   r   r  r  …  s   † õr   r  c                   ó   € ] tR tRtRtRtR# )ÚSoftmini�  zRApplies the Softmin function.

See :func:`softmin` for the functional equivalent.
r   Nr¦   r   r   r   r  r  �  r®   r   r  r¸   r˜   rÄ   rÒ   r  )g      ð¿rÅ   )@r\   Ú	functoolsr   Útypingr   Úmlx.coreÚcorer   Úmlx.nn.layers.baser   r   Úcompiler   r!   r$   r(   r+   r1   r7   r;   r>   rB   rM   rP   rR   rT   r^   rc   re   rn   rs   ru   ry   r|   r   rƒ   r…   r‡   ra   rŠ   r¥   r©   r«   r­   r°   r²   rº   rÇ   rÉ   rË   rÍ   rÔ   rÚ   rÜ   rÞ   rà   rî   rû   rý   rÿ   r	  r  r  r  r   r   r   Ú<module>r     s³  ðó Ý Ý å Ý %òñ 	ˆ�‰˜tÔ$ñó %ðñ 	ˆ�‰˜tÔ$ñó %ðñ 	ˆ�‰˜tÔ$ñ'ó %ð'ñ 	ˆ�‰˜tÔ$ñ-ó %ð-ñ 	ˆ�‰˜tÔ$ó-ó %ð-ñ 	ˆ�‰˜tÔ$ó9ó %ð9ñ 	ˆ�‰˜tÔ$ó7ó %ð7ñ 	ˆ�‰˜tÔ$ó$ó %ð$ñ 	ˆ�‰˜tÔ$ñó %ðñ 	ˆ�‰˜tÔ$ñ'ó %ð'ñ 	ˆ�‰˜tÔ$ö
Bó %ð
Bñ 	ˆ�‰˜tÔ$óQó %ðQñ 	ˆ�‰˜tÔ$ñó %ðñ 	ˆ�‰˜tÔ$ñó %ðñ 	ˆ�‰˜tÔ$ô2ó %ð2ñ 	ˆ�‰˜tÔ$ñSó %ðSñ  	ˆ�‰˜tÔ$ñ%ó %ð%÷*ñ  	ˆ�‰˜tÔ$ö)ó %ð)ñ& 	ˆ�‰˜tÔ$ñ$ó %ð$ñ  	ˆ�‰˜tÔ$ô7ó %ð7ñ 	ˆ�‰˜tÔ$ô$ó %ð$ñ 	ˆ�‰˜tÔ$ñ*ó %ð*ñ 	ˆ�‰˜tÔ$ó7ó %ð7ñ 	ˆ�‰˜tÔ$ó
-ó %ð
-ñ 	ˆ�‰˜tÔ$ó%ó %ð%òô(ˆ&ô (ñ* ˜Ó!ôˆfó ó "ðñ ˜Óôˆ6ó ó ðñ ˜Óôˆ6ó ó ðñ ˜ÓôˆFó ó  ðñ ˜ÓôˆFó ó  ðô3�ô 3ô"#ˆ&ô #ñ$ ˜Ó!ôˆfó ó "ðñ ˜Ó"ôˆvó ó #ðñ ˜Ó"ôˆvó ó #ðô)�ô )ô"$ˆ6ô $ñ& ˜Óôˆ6ó ó ðñ ˜Ó%ô�ó ó &ðñ ˜Ó%ô�ó ó &ðô%ˆFô %ô(*#ˆ6ô *#ñZ ˜Óôˆ6ó ó ðñ ˜Ó#ô�ó ó $ðô'ˆ6ô 'ñ0 ˜Óôˆ6ó ó ðñ ˜Ó#ôˆvó ó $ðñ ˜Ó%ô�ó ó &ðñ ˜Ó!ôˆfó ó "òr   