
    ~Whq                     x    d Z ddlmZ ddlmZ ddlmZ ddlmZ  ed           G d de                      Z	d	S )
z'Rectified Linear Unit activation layer.    )backend)Layer)tf_utils)keras_exportzkeras.layers.ReLUc                   V     e Zd ZdZ	 d fd	Zd Z fdZej        d             Z	 xZ
S )	ReLUa  Rectified Linear Unit activation function.

    With default values, it returns element-wise `max(x, 0)`.

    Otherwise, it follows:

    ```
      f(x) = max_value if x >= max_value
      f(x) = x if threshold <= x < max_value
      f(x) = negative_slope * (x - threshold) otherwise
    ```

    Usage:

    >>> layer = tf.keras.layers.ReLU()
    >>> output = layer([-3.0, -1.0, 0.0, 2.0])
    >>> list(output.numpy())
    [0.0, 0.0, 0.0, 2.0]
    >>> layer = tf.keras.layers.ReLU(max_value=1.0)
    >>> output = layer([-3.0, -1.0, 0.0, 2.0])
    >>> list(output.numpy())
    [0.0, 0.0, 0.0, 1.0]
    >>> layer = tf.keras.layers.ReLU(negative_slope=1.0)
    >>> output = layer([-3.0, -1.0, 0.0, 2.0])
    >>> list(output.numpy())
    [-3.0, -1.0, 0.0, 2.0]
    >>> layer = tf.keras.layers.ReLU(threshold=1.5)
    >>> output = layer([-3.0, -1.0, 1.0, 2.0])
    >>> list(output.numpy())
    [0.0, 0.0, 0.0, 2.0]

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

    Output shape:
      Same shape as the input.

    Args:
      max_value: Float >= 0. Maximum activation value. Default to None, which
        means unlimited.
      negative_slope: Float >= 0. Negative slope coefficient. Default to 0.
      threshold: Float >= 0. Threshold value for thresholded activation. Default
        to 0.
    N        c                     t                      j        di | ||dk     rt          d|           ||dk     rt          d|           ||dk     rt          d|           d| _        |t	          j        |          }|| _        t	          j        |          | _        t	          j        |          | _        d S )Nr	   z@max_value of a ReLU layer cannot be a negative value. Received: zEnegative_slope of a ReLU layer cannot be a negative value. Received: z@threshold of a ReLU layer cannot be a negative value. Received: T )	super__init__
ValueErrorsupports_maskingr   cast_to_floatx	max_valuenegative_slope	threshold)selfr   r   r   kwargs	__class__s        b/var/www/html/movieo_spanner_bot/venv/lib/python3.11/site-packages/keras/layers/activation/relu.pyr   zReLU.__init__K   s    	""6""" Y__0$-0 0   !^c%9%95$25 5   	C0$-0 0  
 !% .y99I"%4^DD /	::    c                 P    t          j        || j        | j        | j                  S )N)alphar   r   )r   relur   r   r   )r   inputss     r   callz	ReLU.callf   s0     |%nn	
 
 
 	
r   c                    | j         | j        | j        d}t                                                      }t          t          |                                          t          |                                          z             S )N)r   r   r   )r   r   r   r   
get_configdictlistitems)r   configbase_configr   s      r   r   zReLU.get_configp   sm    "1
 

 gg((**D**,,--V\\^^0D0DDEEEr   c                     |S )Nr   )r   input_shapes     r   compute_output_shapezReLU.compute_output_shapey   s    r   )Nr	   r	   )__name__
__module____qualname____doc__r   r   r   r   shape_type_conversionr'   __classcell__)r   s   @r   r   r      s        - -` =@; ; ; ; ; ;6
 
 
F F F F F #  $#    r   r   N)
r+   kerasr   keras.engine.base_layerr   keras.utilsr    tensorflow.python.util.tf_exportr   r   r   r   r   <module>r2      s    . -       ) ) ) ) ) )             : 9 9 9 9 9 !""` ` ` ` `5 ` ` #"` ` `r   