class_docstr: Stochastic Depth layer.
  
  Implements Stochastic Depth as described in
  [Deep Networks with Stochastic Depth](https://arxiv.org/abs/1603.09382), to randomly drop residual branches
  in residual architectures.
  
  Usage:
  Residual architectures with fixed depth, use residual branches that are merged back into the main network
  by adding the residual branch back to the input:
  
  >>> input = np.ones((1, 3, 3, 1), dtype = np.float32)
  >>> residual = tf.keras.layers.Conv2D(1, 1)(input)
  >>> output = tf.keras.layers.Add()([input, residual])
  >>> output.shape
  TensorShape([1, 3, 3, 1])
  
  StochasticDepth acts as a drop-in replacement for the addition:
  
  >>> input = np.ones((1, 3, 3, 1), dtype = np.float32)
  >>> residual = tf.keras.layers.Conv2D(1, 1)(input)
  >>> output = tfa.layers.StochasticDepth()([input, residual])
  >>> output.shape
  TensorShape([1, 3, 3, 1])
  
  At train time, StochasticDepth returns:
  
  $$
  x[0] + b_l * x[1],
  $$
  
  where $b_l$ is a random Bernoulli variable with probability $P(b_l = 1) = p_l$
  
  At test time, StochasticDepth rescales the activations of the residual branch based on the survival probability ($p_l$):
  
  $$
  x[0] + p_l * x[1]
  $$
  
  Args:
      survival_probability: float, the probability of the residual branch being kept.
  
  Call Args:
      inputs:  List of `[shortcut, residual]` where `shortcut`, and `residual` are tensors of equal shape.
  
  Output shape:
      Equal to the shape of inputs `shortcut`, and `residual`
code: def get_config(self):
      base_config = super().get_config()
  
      config = {"survival_probability": self.survival_probability}
  
      return {**base_config, **config}
  
file_path: addons/tensorflow_addons/layers/stochastic_depth.py
imports: import tensorflow
  from typeguard import typechecked
label_desc: Use image node_id 4 for calling the StochasticDepth obj's underlying member method code with example usage: obj.get_config() and returns: dict