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, use_legacy_format=False
)
The configuration can be used for persistence and reconstruct the
Optimizer
instance again.
tf.keras.optimizers.serialize(tf.keras.optimizers.legacy.SGD())
{'module': 'keras.optimizers.legacy', 'class_name': 'SGD', 'config': {'name': 'SGD', 'learning_rate': 0.01, 'decay': 0.0, 'momentum': 0.0, 'nesterov': False}, 'registered_name': None}
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.14.0/keras/optimizers/__init__.py#L74-L108) |\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\n\u003cbr /\u003e\n\n tf.keras.optimizers.serialize(\n optimizer, use_legacy_format=False\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.legacy.SGD())\n {'module': 'keras.optimizers.legacy', 'class_name': 'SGD', 'config': {'name': 'SGD', 'learning_rate': 0.01, 'decay': 0.0, 'momentum': 0.0, 'nesterov': False}, 'registered_name': None}"]]