MAPDeconvolver#

class jolideco.core.MAPDeconvolver(n_epochs=1000, beta=1, learning_rate=0.1, compute_error=False, stop_early=False, stop_early_n_average=10, device='cpu', display_progress=True, optimizer='adam')[source]#

Bases: object

Maximum A-Posteriori deconvolver

n_epochs#

Number of epochs to train

Type:

int

beta#

Scale factor for the prior.

Type:

float

learning_rate#

Learning rate

Type:

float

compute_error#

Whether to compute flux error

Type:

bool

stop_early#

Stop training early, once the average results on the last n test datasets do not improve any more.

Type:

bool

stop_early_n_average#

Number of iterations to avergae over.

Type:

int

device#

Pytorch device

Type:

~pytorch.Device

display_progress#

Whether to display a progress bar

Type:

bool

optimizer#

Optimizer to use

Type:

{“adam”, “sgd”}

Methods Summary

run(datasets[, datasets_validation, ...])

Run the MAP deconvolver

to_dict()

Convert deconvolver configuration to dict, with simple data types.

Methods Documentation

run(datasets, datasets_validation=None, components=None, calibrations=None)[source]#

Run the MAP deconvolver

Parameters:
  • datasets (dict of [str, dict]) – Dictionary containing a name of the dataset as key and a dictionary containing, the data like “counts”, “psf”, “background” and “exposure”.

  • datasets_validation (dict of [str, dict]) – Dictionary containing a name of the validation dataset as key and a dictionary containing, the data like “counts”, “psf”, “background” and “exposure”.

  • components (FluxComponents or FluxComponent) – Flux components.

  • calibrations (NPredCalibrations) – Optional model calibrations.

Returns:

flux – Reconstructed flux.

Return type:

~numpy.ndarray

to_dict()[source]#

Convert deconvolver configuration to dict, with simple data types.

Returns:

data – Parameter dict.

Return type:

dict