autolens.SetupHyper

class autolens.SetupHyper(hyper_galaxies_lens: bool = False, hyper_galaxies_source: bool = False, hyper_image_sky: Optional[type] = None, hyper_background_noise: Optional[type] = None, hyper_fixed_after_source: bool = False, search_inversion_cls: Optional[autofit.non_linear.abstract_search.NonLinearSearch] = None, search_noise_cls: Optional[autofit.non_linear.abstract_search.NonLinearSearch] = None, search_bc_cls: Optional[autofit.non_linear.abstract_search.NonLinearSearch] = None, search_inversion_dict: Optional[dict] = None, search_noise_dict: Optional[dict] = None, search_bc_dict: Optional[dict] = None)
__init__(hyper_galaxies_lens: bool = False, hyper_galaxies_source: bool = False, hyper_image_sky: Optional[type] = None, hyper_background_noise: Optional[type] = None, hyper_fixed_after_source: bool = False, search_inversion_cls: Optional[autofit.non_linear.abstract_search.NonLinearSearch] = None, search_noise_cls: Optional[autofit.non_linear.abstract_search.NonLinearSearch] = None, search_bc_cls: Optional[autofit.non_linear.abstract_search.NonLinearSearch] = None, search_inversion_dict: Optional[dict] = None, search_noise_dict: Optional[dict] = None, search_bc_dict: Optional[dict] = None)

The hyper setup of a pipeline, which controls how hyper-features in PyAutoLens template pipelines run, for example controlling whether hyper galaxies are used to scale the noise and the non-linear searches used in these searchs.

Users can write their own pipelines which do not use or require the SetupHyper class.

Parameters:
  • hyper_galaxies – If a hyper-pipeline is being used, this determines if hyper-galaxy functionality is used to scale the noise-map of the dataset throughout the fitting.
  • hyper_image_sky – If a hyper-pipeline is being used, this determines if hyper-galaxy functionality is used include the image’s background sky component in the model.
  • hyper_background_noise – If a hyper-pipeline is being used, this determines if hyper-galaxy functionality is used include the noise-map’s background component in the model.
  • hyper_fixed_after_source – If True, the hyper parameters are fixed and not updated after a desnated pipeline in the analysis. For the SLaM pipelines this is after the SourcePipeline. This allow Bayesian model comparison to be performed objected between later searchs in a pipeline.
  • search_inversion_cls – The non-linear search used by every hyper model-fit search.
  • search_inversion_dict – The dictionary of search options for the hyper model-fit searches.

Methods

__init__(hyper_galaxies_lens, …) The hyper setup of a pipeline, which controls how hyper-features in PyAutoLens template pipelines run, for example controlling whether hyper galaxies are used to scale the noise and the non-linear searches used in these searchs.
hyper_background_noise_from(result)
hyper_galaxy_lens_from(result[, …]) Returns the HyperGalaxy Model from a previous pipeline or search of the lens galaxy in a template PyAutoLens pipeline.
hyper_galaxy_source_from(result[, …]) Returns the HyperGalaxy Model from a previous pipeline or search of the source galaxy in a template PyAutosource pipeline.
hyper_galaxy_via_galaxy_model_from(…[, …])
hyper_image_sky_from(result[, as_model])

Attributes

hypers_all_except_image_sky_off
hypers_all_off
hyper_galaxy_lens_from(result: autofit.non_linear.result.Result, noise_factor_is_model=False)

Returns the HyperGalaxy Model from a previous pipeline or search of the lens galaxy in a template PyAutoLens pipeline.

The HyperGalaxy is extracted from the hyper search of the previous pipeline, and by default has its parameters passed as instance’s which are fixed in the next search.

If noise_factor_is_model is True the noise_factor parameter of the HyperGalaxy is passed as a model and fitted for by the search. This is typically used when the lens model complexity is updated and it is possible that the noise-scaling performed in the previous search (using a simpler lens light model) over-scales the noise for the new more complex light profile.

Parameters:
  • index (int) – The index of the previous search the HyperGalaxy Model is passed from.
  • noise_factor_is_model (bool) – If True the noise_factor of the HyperGalaxy is passed as a model, else it is passed as an instance.
Returns:

The hyper-galaxy that is passed to the next search.

Return type:

af.Model(g.HyperGalaxy)

hyper_galaxy_source_from(result: autofit.non_linear.result.Result, noise_factor_is_model=False)

Returns the HyperGalaxy Model from a previous pipeline or search of the source galaxy in a template PyAutosource pipeline.

The HyperGalaxy is extracted from the hyper search of the previous pipeline, and by default has its parameters passed as instance’s which are fixed in the next search.

If noise_factor_is_model is True the noise_factor parameter of the HyperGalaxy is passed as a model and fitted for by the search. This is typically used when the source model complexity is updated and it is possible that the noise-scaling performed in the previous search (using a simpler source light model) over-scales the noise for the new more complex light profile.

Parameters:
  • index (int) – The index of the previous search the HyperGalaxy Model is passed from.
  • noise_factor_is_model (bool) – If True the noise_factor of the HyperGalaxy is passed as a model, else it is passed as an instance.
Returns:

The hyper-galaxy that is passed to the next search.

Return type:

af.Model(g.HyperGalaxy)