
    &Vf                         d dl Z d dlmZ d dlmZ d dlmZ d dlmZ  ed           G d dej                              ZdS )	    N)backend)layers)ops)keras_exportzkeras.layers.GaussianDropoutc                   <     e Zd ZdZd fd	Zd	dZd Z fdZ xZS )
GaussianDropouta\  Apply multiplicative 1-centered Gaussian noise.

    As it is a regularization layer, it is only active at training time.

    Args:
        rate: Float, drop probability (as with `Dropout`).
            The multiplicative noise will have
            standard deviation `sqrt(rate / (1 - rate))`.
        seed: Integer, optional random seed to enable deterministic behavior.

    Call arguments:
        inputs: Input tensor (of any rank).
        training: Python boolean indicating whether the layer should behave in
            training mode (adding dropout) or in inference mode (doing nothing).
    Nc                      t                      j        di | d|cxk    rdk    sn t          d|           || _        || _        |dk    r$t
          j                            |          | _        d| _	        d S )Nr      zcInvalid value received for argument `rate`. Expected a float value between 0 and 1. Received: rate=T )
super__init__
ValueErrorrateseedr   randomSeedGeneratorseed_generatorsupports_masking)selfr   r   kwargs	__class__s       m/var/www/html/software/conda/lib/python3.11/site-packages/keras/src/layers/regularization/gaussian_dropout.pyr   zGaussianDropout.__init__   s    ""6"""D~~~~A~~~~)"&) )  
 		!88").">">t"D"DD $    Fc                     |rr| j         dk    rgt          j        | j         d| j         z
  z            }|t          j                            t          j        |          d|| j        | j	                  z  S |S )Nr   g      ?)shapemeanstddevdtyper   )
r   mathsqrtr   r   normalr   r   compute_dtyper   )r   inputstrainingr   s       r   callzGaussianDropout.call)   s|     		AYtyC$)O<==FGN11i''(( 2     r   c                     |S Nr   )r   input_shapes     r   compute_output_shapez$GaussianDropout.compute_output_shape5   s    r   c                 n    t                                                      }| j        | j        d}i ||S )N)r   r   )r   
get_configr   r   )r   base_configconfigr   s      r   r+   zGaussianDropout.get_config8   s@    gg((**II
 
 )+(((r   r'   )F)	__name__
__module____qualname____doc__r   r%   r)   r+   __classcell__)r   s   @r   r   r   	   s          % % % % % %
 
 
 
  ) ) ) ) ) ) ) ) )r   r   )	r   	keras.srcr   r   r   keras.src.api_exportr   Layerr   r   r   r   <module>r6      s                       - - - - - - ,--4) 4) 4) 4) 4)fl 4) 4) .-4) 4) 4)r   