rhayes777 / PyAutoFit

PyAutoFit: Classy Probabilistic Programming
https://pyautofit.readthedocs.io/
MIT License
59 stars 11 forks source link

Customizing Priors After analysis.with_free_parameter #1015

Open Jammy2211 opened 4 months ago

Jammy2211 commented 4 months ago

We often use the following API to extend a model over summed analysis classes:

...

analysis = sum(analysis_list)

dataset_model = af.Model(al.DatasetModel)

model = af.Collection(
    dataset_model=dataset_model,
    galaxies=af.Collection(lens=lens, source=source)
)

analysis = analysis.with_free_parameters(
    model.dataset_model.grid_offset
)

I now have a use case where I want to customize the prior on the grid_offset of the DatasetModel corresponding to the second analysis only.

I don't think we currently have an API that allows us to do this?

I cannot achieve the desired behaviour by editing prior configs, because I want the prior on one grid_offset to differ from the other.

Let me know if we have an API hidden, else lets think about how we extend the API.