
    6biZ                         S r SSKrSSKJs  J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	\
R                  5      5       rg)
z#Contains the GaussianDropout layer.    N)backend)
base_layer)tf_utils)keras_exportzkeras.layers.GaussianDropoutc                   j   ^  \ rS rSrSrSU 4S jjrSS jrU 4S jr\R                  S 5       r
SrU =r$ )	GaussianDropout   a  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).

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                 P   > [         TU ]  " SSU0UD6  SU l        Xl        X l        g )NseedT )super__init__supports_maskingrater   )selfr   r   kwargs	__class__s       m/home/james-whalen/.local/lib/python3.13/site-packages/tf_keras/src/layers/regularization/gaussian_dropout.pyr   GaussianDropout.__init__7   s*    -d-f- $		    c                 z   ^ ^ ST R                   s=:  a  S:  a!  O  T$ UU 4S jn[        R                  " UTUS9$ T$ )Nr      c                     > [         R                  " TR                  STR                  -
  -  5      n TTR                  R	                  [
        R                  " T5      SU TR                  S9-  $ )Ng      ?)shapemeanstddevdtype)npsqrtr   _random_generatorrandom_normaltfr   r   )r   inputsr   s    r   noised$GaussianDropout.call.<locals>.noised@   sa    cDIIo!>? 6 6 D D((6*! ,,	 !E !  r   )training)r   r   in_train_phase)r   r#   r&   r$   s   ``  r   callGaussianDropout.call=   s<    tyy1  ))&&8LLr   c                    > U R                   U R                  S.n[        TU ]  5       n[	        [        UR                  5       5      [        UR                  5       5      -   5      $ )N)r   r   )r   r   r   
get_configdictlistitems)r   configbase_configr   s      r   r+   GaussianDropout.get_configL   sK    ))TYY7g(*D**,-V\\^0DDEEr   c                     U$ Nr   )r   input_shapes     r   compute_output_shape$GaussianDropout.compute_output_shapeQ   s    r   )r   r   r   r3   )__name__
__module____qualname____firstlineno____doc__r   r(   r+   r   shape_type_conversionr5   __static_attributes____classcell__)r   s   @r   r   r      s2    0F
 ## $r   r   )r;   numpyr   tensorflow.compat.v2compatv2r"   tf_keras.srcr   tf_keras.src.enginer   tf_keras.src.utilsr    tensorflow.python.util.tf_exportr   BaseRandomLayerr   r   r   r   <module>rH      sJ    *  ! !   * ' : ,-5j00 5 .5r   