View source on GitHub |
Returns function.
tf.keras.activations.get(
identifier
)
identifier
: Function or stringActivation function denoted by input:
- Linear activation function
if input is None
.
- Function corresponding to the input string or input function.
>>> 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('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.