wf_psf.psf_models.psf_model_loader
PSF Model Loader.
This module provides helper functions for loading trained PSF models. It includes utilities to: - Load a model from disk using its configuration and weights. - Prepare inputs for inference or evaluation workflows.
Author: Jennifer Pollack <jennifer.pollack@cea.fr>
Functions
|
Loads a trained PSF model and applies saved weights. |
- wf_psf.psf_models.psf_model_loader.load_trained_psf_model(training_conf, data_conf, weights_path_pattern)[source]
Loads a trained PSF model and applies saved weights.
- Parameters:
training_conf (RecursiveNamespace) – Configuration object containing model parameters and training hyperparameters. Supports attribute-style access to nested fields.
data_conf (RecursiveNamespace or dict) – Configuration RecursiveNamespace object or a dictionary containing data parameters (e.g. pixel data, positions, masks, etc).
weights_path_pattern (str) – Glob-style pattern used to locate the model weights file.
- Returns:
model – The PSF model instance with loaded weights.
- Return type:
tf.keras.Model or compatible
- Raises:
RuntimeError – If loading the model weights fails for any reason.