Commit 4c1d57d2 authored by Yuxin Wu's avatar Yuxin Wu

notes about tf.nn.leaky_relu

parent 205a9ff4
......@@ -7,6 +7,8 @@ import tensorflow as tf
from .common import layer_register, VariableHolder
from .batch_norm import BatchNorm
from ..tfutils.common import get_tf_version_number
from ..utils import logger
__all__ = ['Maxout', 'PReLU', 'LeakyReLU', 'BNReLU']
......@@ -71,6 +73,9 @@ def LeakyReLU(x, alpha, name='output'):
x (tf.Tensor): input
alpha (float): the slope.
"""
# TODO
if get_tf_version_number() >= 1.4:
logger.warn("You are recommended to use tf.nn.leaky_relu available since TF 1.4 rather than models.LeakyReLU.")
return tf.maximum(x, alpha * x, name=name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment