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 |
Tensorlow Activation function denoted by input string.
|
For example:
tf.keras.activations.deserialize('linear')
tf.keras.activations.deserialize('sigmoid')
tf.keras.activations.deserialize('abcd')
Traceback (most recent call last):
...
ValueError: Unknown activation function:abcd
Args |
name
|
The name of the actiuvation 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.1.0/tensorflow/python/keras/activations.py#L374-L407) |\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| Tensorlow Activation function denoted by input string. ||\n\n\u003cbr /\u003e\n\n#### For example:\n\n\u003e \u003e \u003e tf.keras.activations.deserialize('linear')\n\u003e \u003e \u003e tf.keras.activations.deserialize('sigmoid') tf.keras.activations.deserialize('abcd') Traceback (most recent call last): ... 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 actiuvation 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"]]