Last active
May 23, 2019 08:14
-
-
Save oborchers/2732decb2b1cfd878ce14df0bfd76a30 to your computer and use it in GitHub Desktop.
Computes the Non-Negative Exponential Linear Unit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
def nnelu(input): | |
""" Computes the Non-Negative Exponential Linear Unit | |
""" | |
return tf.add(tf.constant(1, dtype=tf.float32), tf.nn.elu(input)) | |
tf.keras.utils.get_custom_objects().update({'nnelu': Activation(nnelu)}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If mdn_nnelu.py is used without the rest of the code, than Activation is not defined. You can use "tf.keras.layers.Activation(nnelu)" or "from tf.keras.layers import Activation" instead