
    :|h
                     T    d dl mZ d dlmZ d dlmZ  ed       G d de             Zy)    )activations)keras_export)Layerzkeras.layers.ReLUc                   <     e Zd ZdZ	 d fd	Zd Z fdZd Z xZS )ReLUa  Rectified Linear Unit activation function layer.

    Formula:
    ``` python
    f(x) = max(x,0)
    f(x) = max_value if x >= max_value
    f(x) = x if threshold <= x < max_value
    f(x) = negative_slope * (x - threshold) otherwise
    ```

    Example:
    ``` python
    relu_layer = keras.layers.ReLU(
        max_value=10,
        negative_slope=0.5,
        threshold=0,
    )
    input = np.array([-10, -5, 0.0, 5, 10])
    result = relu_layer(input)
    # result = [-5. , -2.5,  0. ,  5. , 10.]
    ```

    Args:
        max_value: Float >= 0. Maximum activation value. None means unlimited.
            Defaults to `None`.
        negative_slope: Float >= 0. Negative slope coefficient.
            Defaults to `0.0`.
        threshold: Float >= 0. Threshold value for thresholded activation.
            Defaults to `0.0`.
        **kwargs: Base layer keyword arguments, such as `name` and `dtype`.
    c                     t        |   di | ||dk  rt        d|       ||dk  rt        d|       ||dk  rt        d|       || _        || _        || _        d| _        | j                          y )N        zJmax_value of a ReLU layer cannot be a negative value. Received: max_value=zTnegative_slope of a ReLU layer cannot be a negative value. Received: negative_slope=zJthreshold of a ReLU layer cannot be a negative value. Received: threshold=T )super__init__
ValueError	max_valuenegative_slope	thresholdsupports_masking_build_at_init)selfr   r   r   kwargs	__class__s        `/var/www/html/test/engine/venv/lib/python3.12/site-packages/keras/src/layers/activations/relu.pyr   zReLU.__init__(   s     	"6" Y_..7[:  !^c%933A2BD  	C..7[: 
 #," $    c                 p    t        j                  || j                  | j                  | j                        S )N)r   r   r   )r   relur   r   r   )r   inputss     r   callz	ReLU.callC   s/    ..nnnn	
 	
r   c                     t         |          }|j                  | j                  | j                  | j
                  d       |S )N)r   r   r   )r   
get_configupdater   r   r   )r   configr   s     r   r   zReLU.get_configK   s?    #%!^^"&"5"5!^^	
 r   c                     |S )Nr
   )r   input_shapes     r   compute_output_shapezReLU.compute_output_shapeV   s    r   )Nr	   r	   )	__name__
__module____qualname____doc__r   r   r   r"   __classcell__)r   s   @r   r   r      s#    B =@6
	r   r   N)	keras.srcr   keras.src.api_exportr   keras.src.layers.layerr   r   r
   r   r   <module>r+      s2    ! - ( !"P5 P #Pr   