
    &Vfn
                     h    d dl mZ d dlmZ d dlmZ  ed           G d de                      ZdS )    )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.activations.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`.
    N        c                     t                      j        di | ||dk     rt          d|           ||dk     rt          d|           ||dk     rt          d|           d| _        || _        || _        || _        d S )Nr   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supports_masking	max_valuenegative_slope	threshold)selfr   r   r   kwargs	__class__s        ^/var/www/html/software/conda/lib/python3.11/site-packages/keras/src/layers/activations/relu.pyr   zReLU.__init__(   s     	""6""" Y__:.7: :   !^c%9%9D3AD D   	C:.7: :  
 !%","    c                 P    t          j        || j        | j        | j                  S )N)r   r   r   )r   relur   r   r   )r   inputss     r   callz	ReLU.callA   s/    .nn	
 
 
 	
r   c                     t                                                      }|                    | j        | j        | j        d           |S )N)r   r   r   )r   
get_configupdater   r   r   )r   configr   s     r   r   zReLU.get_configI   sO    ##%%!^"&"5!^ 	
 	
 	
 r   c                     |S )Nr
   )r   input_shapes     r   compute_output_shapezReLU.compute_output_shapeT   s    r   )Nr   r   )	__name__
__module____qualname____doc__r   r   r   r!   __classcell__)r   s   @r   r   r      s         B =@# # # # # #2
 
 
	 	 	 	 	      r   r   N)	keras.srcr   keras.src.api_exportr   keras.src.layers.layerr   r   r
   r   r   <module>r*      s    ! ! ! ! ! ! - - - - - - ( ( ( ( ( ( !""N N N N N5 N N #"N N Nr   