
    6bi	                     v    S r SSKJs  Jr  SSKJr  SSKJr  SSK	J
r
  SSKJr  \" S5       " S S	\5      5       rg)
z3Thresholded Rectified Linear Unit activation layer.    N)backend)Layer)tf_utils)keras_exportzkeras.layers.ThresholdedReLUc                   f   ^  \ rS rSrSrSU 4S jjrS rU 4S jr\R                  S 5       r
SrU =r$ )	ThresholdedReLU   a  Thresholded Rectified Linear Unit.

It follows:

```
    f(x) = x for x > theta
    f(x) = 0 otherwise`
```

Input shape:
    Arbitrary. Use the keyword argument `input_shape`
    (tuple of integers, does not include the samples axis)
    when using this layer as the first layer in a model.

Output shape:
    Same shape as the input.

Args:
    theta: Float >= 0. Threshold location of activation.
c                    > [         TU ]  " S0 UD6  Uc  [        SU 35      eUS:  a  [        SU 35      eSU l        [        R
                  " U5      U l        g )NzOTheta of a Thresholded ReLU layer cannot be None, expecting a float. Received: r   zEThe theta value of a Thresholded ReLU layer should be >=0. Received: T )super__init__
ValueErrorsupports_maskingr   cast_to_floatxtheta)selfr   kwargs	__class__s      i/home/james-whalen/.local/lib/python3.13/site-packages/tf_keras/src/layers/activation/thresholded_relu.pyr   ThresholdedReLU.__init__3   su    "6"=$$)7,  19,,174  !%++E2
    c                     U R                   nU[        R                  " [        R                  " XR                  5      U5      -  $ N)compute_dtypetfcastgreaterr   )r   inputsdtypes      r   callThresholdedReLU.callB   s0    ""

6:: >FFFr   c                    > S[        U R                  5      0n[        TU ]  5       n[	        [        UR                  5       5      [        UR                  5       5      -   5      $ )Nr   )floatr   r   
get_configdictlistitems)r   configbase_configr   s      r   r$   ThresholdedReLU.get_configF   sL    5,-g(*D**,-V\\^0DDEEr   c                     U$ r   r   )r   input_shapes     r   compute_output_shape$ThresholdedReLU.compute_output_shapeK   s    r   )r   r   )g      ?)__name__
__module____qualname____firstlineno____doc__r   r    r$   r   shape_type_conversionr-   __static_attributes____classcell__)r   s   @r   r   r      s3    *3GF
 ## $r   r   )r3   tensorflow.compat.v2compatv2r   tf_keras.srcr   tf_keras.src.engine.base_layerr   tf_keras.src.utilsr    tensorflow.python.util.tf_exportr   r   r   r   r   <module>r>      sA    : " !   0 ' : ,-0e 0 .0r   