W3cubDocs

/TensorFlow 2.4

tf.keras.activations.get

Returns function.

Arguments
identifier Function or string
Returns
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('abcd')
Traceback (most recent call last):

ValueError: Unknown activation function:abcd
Raises
ValueError Input is an unknown function or string, i.e., the input does not denote any defined function.

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.4/api_docs/python/tf/keras/activations/get