Parameterized ReLU as in the paper `Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification `_. Args: x (tf.Tensor): input init (float): initial value for the learnable slope. name (str): d
(x, init=0.001, name=None)
| 40 | @layer_register() |
| 41 | @disable_autograph() |
| 42 | def PReLU(x, init=0.001, name=None): |
| 43 | """ |
| 44 | Parameterized ReLU as in the paper `Delving Deep into Rectifiers: Surpassing |
| 45 | Human-Level Performance on ImageNet Classification |
| 46 | <http://arxiv.org/abs/1502.01852>`_. |
| 47 | |
| 48 | Args: |
| 49 | x (tf.Tensor): input |
| 50 | init (float): initial value for the learnable slope. |
| 51 | name (str): deprecated argument. Don't use |
| 52 | |
| 53 | Variable Names: |
| 54 | |
| 55 | * ``alpha``: learnable slope. |
| 56 | """ |
| 57 | if name is not None: |
| 58 | log_deprecated("PReLU(name=...)", "The output tensor will be named `output`.") |
| 59 | init = tfv1.constant_initializer(init) |
| 60 | alpha = tfv1.get_variable('alpha', [], initializer=init) |
| 61 | x = ((1 + alpha) * x + (1 - alpha) * tf.abs(x)) |
| 62 | ret = tf.multiply(x, 0.5, name=name or None) |
| 63 | |
| 64 | ret.variables = VariableHolder(alpha=alpha) |
| 65 | return ret |
| 66 | |
| 67 | |
| 68 | @layer_register(use_scope=None) |
no test coverage detected