
    &Vf                     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 )    )regularizers)keras_export)Layerz#keras.layers.ActivityRegularizationc                   :     e Zd ZdZd fd	Zd Zd Z fdZ xZS )ActivityRegularizationa  Layer that applies an update to the cost function based input activity.

    Args:
        l1: L1 regularization factor (positive float).
        l2: L2 regularization factor (positive float).

    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 input.
            c                      t                      j        ddt          j        ||          i| d| _        || _        || _        d S )Nactivity_regularizerl1l2T )super__init__r   L1L2supports_maskingr   r   )selfr   r   kwargs	__class__s       t/var/www/html/software/conda/lib/python3.11/site-packages/keras/src/layers/regularization/activity_regularization.pyr   zActivityRegularization.__init__   s_     	
 	
!-!2bR!@!@!@	
DJ	
 	
 	
 !%    c                     |S Nr   )r   inputss     r   callzActivityRegularization.call   s    r   c                     |S r   r   )r   input_shapes     r   compute_output_shapez+ActivityRegularization.compute_output_shape"   s    r   c                 n    t                                                      }| j        | j        d}i ||S )Nr   )r   
get_configr   r   )r   base_configconfigr   s      r   r    z!ActivityRegularization.get_config%   s9    gg((**tw//(+(((r   )r   r   )	__name__
__module____qualname____doc__r   r   r   r    __classcell__)r   s   @r   r   r      s~                  ) ) ) ) ) ) ) ) )r   r   N)	keras.srcr   keras.src.api_exportr   keras.src.layers.layerr   r   r   r   r   <module>r+      s    " " " " " " - - - - - - ( ( ( ( ( ( 344!) !) !) !) !)U !) !) 54!) !) !)r   