tf.keras.losses.serialize
Stay organized with collections
Save and categorize content based on your preferences.
Serializes loss function or Loss
instance.
tf.keras.losses.serialize(
loss, use_legacy_format=False
)
Args |
loss
|
A Keras Loss instance or a loss function.
|
use_legacy_format
|
Boolean, whether to use the legacy serialization
format. Defaults to False .
|
Returns |
Loss configuration dictionary.
|
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.losses.serialize\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/keras-team/keras/tree/v2.14.0/keras/losses.py#L2871-L2893) |\n\nSerializes loss function or `Loss` instance.\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tf.losses.serialize`](https://www.tensorflow.org/api_docs/python/tf/keras/losses/serialize)\n\n\u003cbr /\u003e\n\n tf.keras.losses.serialize(\n loss, use_legacy_format=False\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------------------|-------------------------------------------------------------------------------|\n| `loss` | A Keras `Loss` instance or a loss function. |\n| `use_legacy_format` | Boolean, whether to use the legacy serialization format. Defaults to `False`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| Loss configuration dictionary. ||\n\n\u003cbr /\u003e"]]