Open xiongma opened 5 years ago
def layer_dropout(inputs, residual, dropout): pred = tf.random_uniform([]) < dropout return tf.cond(pred, lambda: residual, lambda: tf.nn.dropout(inputs, 1.0 - dropout) + residual)
@localminimum hope you can reply this, thx
def layer_dropout(inputs, residual, dropout): pred = tf.random_uniform([]) < dropout return tf.cond(pred, lambda: residual, lambda: tf.nn.dropout(inputs, 1.0 - dropout) + residual)