

def relu(x, alpha=0.0, max_value=None):
    'Rectified linear unit\n\n    # Arguments\n        alpha: slope of negative section.\n        max_value: saturation threshold.\n    '
    negative_part = tf.nn.relu((- x))
    x = tf.nn.relu(x)
    if (max_value is not None):
        x = tf.clip_by_value(x, tf.cast(0.0, dtype=_FLOATX), tf.cast(max_value, dtype=_FLOATX))
    if (isinstance(alpha, (tuple, list, np.ndarray)) or np.isscalar(alpha)):
        alpha = tf.constant(alpha, dtype=_FLOATX)
    x -= (alpha * negative_part)
    return x

dataset/ETHPy150Open fchollet/keras/keras/backend/tensorflow_backend.py relu/original