tensorflow / 2.9.1 / keras / optimizers / serialize.html /

tf.keras.optimizers.serialize

Serialize the optimizer configuration to JSON compatible python dict.

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.

© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/keras/optimizers/serialize