Returns the string identifier of an activation function.
View aliases
Compat aliases for migration
See
Migration guide for
more details.
`tf.compat.v1.keras.activations.serialize`
tf.keras.activations.serialize(
activation, use_legacy_format=False
)
Args |
activation
|
Function object.
|
Returns |
String denoting the name attribute of the input function
|
Example:
tf.keras.activations.serialize(tf.keras.activations.tanh)
'tanh'
tf.keras.activations.serialize(tf.keras.activations.sigmoid)
'sigmoid'
tf.keras.activations.serialize('abcd')
Traceback (most recent call last):
ValueError: Unknown activation function 'abcd' cannot be serialized.
Raises |
ValueError
|
The input function is not a valid one.
|