ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more


TensorFlow 1 version View source on GitHub

Returns activation function given a string identifier.

x String identifier.

Corresponding activation function.

For example:

 <function linear at 0x1239596a8>
 <function sigmoid at 0x123959510>
Traceback (most recent call last):

ValueError: Unknown activation function:abcd

name The name of the activation function.
custom_objects Optional {function_name: function_obj} dictionary listing user-provided activation functions.

ValueError Unknown activation function if the input string does not denote any defined Tensorflow activation function.