deserialize#

bayesflow.utils.serialization.deserialize(config: dict, custom_objects=None, safe_mode=True, **kwargs)[source]#

Deserialize an object serialized with serialize().

Wrapper function around keras.saving.deserialize_keras_object to enable deserialization of classes.

Parameters:
configdict

Python dict describing the object.

custom_objectsdict, optional

Python dict containing a mapping between custom object names and the corresponding classes or functions. Forwarded to keras.saving.deserialize_keras_object.

safe_modebool, optional

Boolean, whether to disallow unsafe lambda deserialization. When safe_mode=False, loading an object has the potential to trigger arbitrary code execution. This argument is only applicable to the Keras v3 model format. Defaults to True. Forwarded to keras.saving.deserialize_keras_object.

Returns:
obj

The object described by the config dictionary.

Raises:
ValueError

If a type in the config can not be deserialized.

See also

serialize