deeppavlov/core/layers/tf_layers.py
def variational_dropout(units, keep_prob, fixed_mask_dims=(1,)):
    """ Dropout with the same drop mask for all fixed_mask_dims

    Args:
        units: a tensor, usually with shapes [B x T x F], where
            B - batch size
            T - tokens dimension
            F - feature dimension
        keep_prob: keep probability
        fixed_mask_dims: in these dimensions the mask will be the same

    Returns:
        dropped units tensor
    """
    units_shape = tf.shape(units)
    noise_shape = [units_shape[n] for n in range(len(units.shape))]
    for dim in fixed_mask_dims:
        noise_shape[dim] = 1
    return tf.nn.dropout(units, keep_prob, noise_shape)
def variational_dropout(units, keep_prob, fixed_mask_dims=(1,)):
    units_shape = tf.shape(units)
    noise_shape = [units_shape[n] for n in range(len(units.shape))]
    for dim in fixed_mask_dims:
        noise_shape[dim] = 1
    return tf.nn.dropout(units, keep_prob, noise_shape)
def variational_dropout ( units , keep_prob , fixed_mask_dims = ( 1 , ) ) : units_shape = tf . shape ( units ) noise_shape = [ units_shape [ n ] for n in range ( len ( units . shape ) ) ] for dim in fixed_mask_dims : noise_shape [ dim ] = 1 return tf . nn . dropout ( units , keep_prob , noise_shape )
Dropout with the same drop mask for all fixed_mask_dims

    Args:
        units: a tensor, usually with shapes [B x T x F], where
            B - batch size
            T - tokens dimension
            F - feature dimension
        keep_prob: keep probability
        fixed_mask_dims: in these dimensions the mask will be the same

    Returns:
        dropped units tensor
Dropout with the same drop mask for all fixed_mask_dims