wf_psf.training.training_config_handler

Training Config Handler.

A module which provides a class to manage the parameters of the training config file.

Authors:

Jennifer Pollack <jennifer.pollack@cea.fr>

Functions

prepare_training_inputs(data_params, simPSF, ...)

Build a training-ready data adapter and PSF model.

Classes

TrainingConfigHandler(training_conf, ...)

TrainingConfigHandler.

class wf_psf.training.training_config_handler.TrainingConfigHandler(training_conf, file_handler)[source]

Bases: ConfigHandler

TrainingConfigHandler.

A class to handle training configuration parameters.

Parameters:
  • ids (tuple) – A tuple containing a string id for the Configuration Class

  • training_conf (str) – Path of the training configuration file

  • file_handler (object) – A instance of the FileIOHandler class

Methods

run()

Run.

ids: tuple[str, ...] = ('training_conf',)
run()[source]

Run.

A function to run wavediff according to the input configuration.

wf_psf.training.training_config_handler.prepare_training_inputs(data_params, simPSF, n_bins_lambda, loss, model_params, training_hparams) tuple[TrainingDataAdapter, Model][source]

Build a training-ready data adapter and PSF model.

The sequence is order-dependent: the dataset must be joined into complete form before PSF model initialisation (certain models require the full dataset), then split and converted to tensors afterward.

Parameters:
  • data_params (RecursiveNamespace or SHEPSFDataset) – Data configuration parameters or a pre-loaded in-memory dataset.

  • simPSF (PSFSimulator) – PSF simulator instance used for SED encoding during conversion.

  • n_bins_lambda (int) – Number of wavelength bins for SED discretisation.

  • loss (str) – Loss function identifier, determines whether masks are packed with target images in the training adapter.

  • model_params (RecursiveNamespace) – PSF model configuration parameters.

  • training_hparams (RecursiveNamespace) – Training hyperparameters passed to PSF model initialisation.

Returns:

A fully prepared training adapter and initialised PSF model, ready to be passed to the training loop.

Return type:

tuple[TrainingDataAdapter, PSFModel]