tf.keras.optimizers.serialize
Stay organized with collections
Save and categorize content based on your preferences.
Serialize the optimizer configuration to JSON compatible python dict.
tf.keras.optimizers.serialize(
optimizer
)
The configuration can be used for persistence and reconstruct the
Optimizer
instance again.
tf.keras.optimizers.serialize(tf.keras.optimizers.SGD())
{'class_name': 'SGD', 'config': {'name': 'SGD', 'learning_rate': 0.01,
'decay': 0.0, 'momentum': 0.0,
'nesterov': False} }
Args |
optimizer
|
An Optimizer instance to serialize.
|
Returns |
Python dict which contains the configuration of the input optimizer.
|
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. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tf.keras.optimizers.serialize\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/keras-team/keras/tree/v2.10.0/keras/optimizers/__init__.py#L86-L104) |\n\nSerialize the optimizer configuration to JSON compatible python dict.\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tf.optimizers.serialize`](https://www.tensorflow.org/api_docs/python/tf/keras/optimizers/serialize)\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.optimizers.serialize\\`\n\n\u003cbr /\u003e\n\n tf.keras.optimizers.serialize(\n optimizer\n )\n\nThe configuration can be used for persistence and reconstruct the\n`Optimizer` instance again. \n\n tf.keras.optimizers.serialize(tf.keras.optimizers.SGD())\n {'class_name': 'SGD', 'config': {'name': 'SGD', 'learning_rate': 0.01,\n 'decay': 0.0, 'momentum': 0.0,\n 'nesterov': False} }\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-------------|---------------------------------------|\n| `optimizer` | An `Optimizer` instance to serialize. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| Python dict which contains the configuration of the input optimizer. ||\n\n\u003cbr /\u003e"]]