tf.keras.activations.get

TensorFlow 1 version View source on GitHub

Returns function.

identifier Function or string

Activation function denoted by input:

  • Linear activation function if input is None.
  • Function corresponding to the input string or input function.

For example:

tf.keras.activations.get('softmax')
 <function softmax at 0x1222a3d90>
tf.keras.activations.get(tf.keras.activations.softmax)
 <function softmax at 0x1222a3d90>
tf.keras.activations.get(None)
 <function linear at 0x1239596a8>
tf.keras.activations.get(abs)
 <built-in function abs>
tf.keras.activations.get(&#x27;abcd')
Traceback (most recent call last):

ValueError: Unknown activation function:abcd

ValueError Input is an unknown function or string, i.e., the input does not denote any defined function.