a
    Sic                     @   sD   d Z ddlmZ ddlmZ ddlmZ edG dd deZdS )	z*Contains the ActivityRegularization layer.    )regularizers)Layer)keras_exportz#keras.layers.ActivityRegularizationc                       s6   e Zd ZdZd	 fdd	Zdd Z fddZ  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                    s6   t  jf dtj||di| d| _|| _|| _d S )Nactivity_regularizerl1l2T)super__init__r   L1L2supports_maskingr	   r
   )selfr	   r
   kwargs	__class__ o/var/www/html/django/DPS/env/lib/python3.9/site-packages/keras/layers/regularization/activity_regularization.pyr   *   s    
zActivityRegularization.__init__c                 C   s   |S )Nr   )r   input_shaper   r   r   compute_output_shape2   s    z+ActivityRegularization.compute_output_shapec                    s4   | j | jd}t  }tt| t|  S )Nr   )r	   r
   r   
get_configdictlistitems)r   configbase_configr   r   r   r   5   s    
z!ActivityRegularization.get_config)r   r   )__name__
__module____qualname____doc__r   r   r   __classcell__r   r   r   r   r      s   r   N)r    kerasr   keras.engine.base_layerr    tensorflow.python.util.tf_exportr   r   r   r   r   r   <module>   s
   