zea.models.preset_utils¶
Mostly from keras_hub.src.models import preset_utils
Functions
|
Find all registered built-in presets for a class. |
|
Validate a preset is being loaded on the correct class. |
|
Check if a file exists in a preset. |
|
Download a preset file in necessary and return the local path. |
|
Get a preset loader. |
|
Get a preset saver. |
|
Cleanup memory for JAX models. |
|
Convert a Keras class name to a zea registry name. |
|
Load a JSON file from a preset. |
|
Load a serialized Keras object from a config. |
|
Register built-in presets for a set of classes. |
|
Set the dtype in a serialized Keras config. |
Classes
|
Loader for Keras serialized presets. |
|
Saver for Keras serialized presets. |
|
Base class for loading a model from a preset. |
- class zea.models.preset_utils.KerasPresetLoader(preset, config)[source]¶
Bases:
PresetLoader
Loader for Keras serialized presets.
- class zea.models.preset_utils.KerasPresetSaver(preset_dir)[source]¶
Bases:
object
Saver for Keras serialized presets.
- class zea.models.preset_utils.PresetLoader(preset, config)[source]¶
Bases:
object
Base class for loading a model from a preset.
- zea.models.preset_utils.builtin_presets(cls)[source]¶
Find all registered built-in presets for a class.
- zea.models.preset_utils.check_config_class(config)[source]¶
Validate a preset is being loaded on the correct class.
- zea.models.preset_utils.check_file_exists(preset, path)[source]¶
Check if a file exists in a preset.
- zea.models.preset_utils.get_file(preset, path)[source]¶
Download a preset file in necessary and return the local path.
- zea.models.preset_utils.keras_to_zea_registry(keras_name, zea_registry)[source]¶
Convert a Keras class name to a zea registry name.
- zea.models.preset_utils.load_json(preset, config_file='config.json')[source]¶
Load a JSON file from a preset.
- zea.models.preset_utils.load_serialized_object(config, **kwargs)[source]¶
Load a serialized Keras object from a config.