nip.model_cache

nip.model_cache#

Utilities for saving and loading models together with their parameters.

The parameters should completely specify the model, up to changes in the codebase.

Functions

cached_models_exist(hyper_params, subdir)

Check whether cached models exist with the given parameters.

get_cached_models_path(hyper_params, subdir)

Get the path to the directory containing the models with the given parameters.

load_cached_model_state_dicts(models, ...)

Load the state dict of cached models into models.

save_model_state_dicts(models, hyper_params, ...)

Save a model and its parameters.

Exceptions

ModelNotFoundError(message)

Raised when a model is not found.