
    6bi:
                     d    S 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	)
z:Leaky version of a Rectified Linear Unit activation layer.    )backend)Layer)tf_utils)keras_exportzkeras.layers.LeakyReLUc                   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$ )		LeakyReLU   a  Leaky version of a Rectified Linear Unit.

It allows a small gradient when the unit is not active:

```
    f(x) = alpha * x if x < 0
    f(x) = x if x >= 0
```

Usage:

>>> layer = tf.keras.layers.LeakyReLU()
>>> output = layer([-3.0, -1.0, 0.0, 2.0])
>>> list(output.numpy())
[-0.9, -0.3, 0.0, 2.0]
>>> layer = tf.keras.layers.LeakyReLU(alpha=0.1)
>>> output = layer([-3.0, -1.0, 0.0, 2.0])
>>> list(output.numpy())
[-0.3, -0.1, 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:
    alpha: Float >= `0.`. Negative slope coefficient. Defaults to `0.3`.

c                    > [         TU ]  " S0 UD6  Uc  [        SU 35      eSU l        [        R
                  " U5      U l        g )NzSThe alpha value of a Leaky ReLU layer cannot be None, Expecting a float. Received: T )super__init__
ValueErrorsupports_maskingr   cast_to_floatxalpha)selfr   kwargs	__class__s      c/home/james-whalen/.local/lib/python3.13/site-packages/tf_keras/src/layers/activation/leaky_relu.pyr   LeakyReLU.__init__=   sP    "6"=005w8  !%++E2
    c                 >    [         R                  " XR                  S9$ )N)r   )r   relur   )r   inputss     r   callLeakyReLU.callG   s    ||F**55r   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   LeakyReLU.get_configJ   sL    5,-g(*D**,-V\\^0DDEEr   c                     U$ )Nr   )r   input_shapes     r   compute_output_shapeLeakyReLU.compute_output_shapeO   s    r   )r   r   )g333333?)__name__
__module____qualname____firstlineno____doc__r   r   r   r   shape_type_conversionr(   __static_attributes____classcell__)r   s   @r   r   r      s3    B36F
 ## $r   r   N)
r.   tf_keras.srcr   tf_keras.src.engine.base_layerr   tf_keras.src.utilsr    tensorflow.python.util.tf_exportr   r   r   r   r   <module>r6      s<    A ! 0 ' : &'6 6 (6r   