tf.keras.activations.deserialize
Stay organized with collections
Save and categorize content based on your preferences.
Returns activation function denoted by input string.
tf.keras.activations.deserialize(
name, custom_objects=None
)
Returns |
TensorFlow Activation function denoted by input string.
|
For example:
tf.keras.activations.deserialize('linear')
<function linear at 0x1239596a8>
tf.keras.activations.deserialize('sigmoid')
<function sigmoid at 0x123959510>
tf.keras.activations.deserialize('abcd')
Traceback (most recent call last):
ValueError: Unknown activation function:abcd
Args |
name
|
The name of the activation function.
|
custom_objects
|
A {name:value} dictionary for activations not build into
keras.
|
Raises |
ValueError
|
Unknown activation function if the input string does not
denote any defined Tensorflow activation function.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.keras.activations.deserialize\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/keras/activations/deserialize) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/keras/activations.py#L388-L422) |\n\nReturns activation function denoted by input string.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.keras.activations.deserialize`](/api_docs/python/tf/keras/activations/deserialize)\n\n\u003cbr /\u003e\n\n tf.keras.activations.deserialize(\n name, custom_objects=None\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Arguments --------- ||\n|-----|--------|\n| `x` | String |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| TensorFlow Activation function denoted by input string. ||\n\n\u003cbr /\u003e\n\n#### For example:\n\n tf.keras.activations.deserialize('linear')\n \u003cfunction linear at 0x1239596a8\u003e\n tf.keras.activations.deserialize('sigmoid')\n \u003cfunction sigmoid at 0x123959510\u003e\n tf.keras.activations.deserialize('abcd')\n Traceback (most recent call last):\n\n ValueError: Unknown activation function:abcd\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------------|-----------------------------------------------------------------|\n| `name` | The name of the activation function. |\n| `custom_objects` | A {name:value} dictionary for activations not build into keras. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|---------------------------------------------------------------------------------------------------------------|\n| `ValueError` | `Unknown activation function` if the input string does not denote any defined Tensorflow activation function. |\n\n\u003cbr /\u003e"]]