Пример #1
0
    def test__loads_from_config_file_correct(self):

        zeus = af.Zeus(
            prior_passer=af.PriorPasser(sigma=2.0,
                                        use_errors=False,
                                        use_widths=False),
            nwalkers=51,
            nsteps=2001,
            initializer=af.InitializerBall(lower_limit=0.2, upper_limit=0.8),
            auto_correlations_settings=af.AutoCorrelationsSettings(
                check_for_convergence=False,
                check_size=101,
                required_length=51,
                change_threshold=0.02),
            tune=False,
            number_of_cores=2,
        )

        assert zeus.prior_passer.sigma == 2.0
        assert zeus.prior_passer.use_errors is False
        assert zeus.prior_passer.use_widths is False
        assert zeus.config_dict_search["nwalkers"] == 51
        assert zeus.config_dict_run["nsteps"] == 2001
        assert zeus.config_dict_run["tune"] == False
        assert isinstance(zeus.initializer, af.InitializerBall)
        assert zeus.initializer.lower_limit == 0.2
        assert zeus.initializer.upper_limit == 0.8
        assert zeus.auto_correlations_settings.check_for_convergence is False
        assert zeus.auto_correlations_settings.check_size == 101
        assert zeus.auto_correlations_settings.required_length == 51
        assert zeus.auto_correlations_settings.change_threshold == 0.02
        assert zeus.number_of_cores == 2

        zeus = af.Zeus()

        assert zeus.prior_passer.sigma == 3.0
        assert zeus.prior_passer.use_errors is True
        assert zeus.prior_passer.use_widths is True
        assert zeus.config_dict_search["nwalkers"] == 50
        assert zeus.config_dict_run["nsteps"] == 2000
        assert zeus.config_dict_run["tune"] == True
        assert isinstance(zeus.initializer, af.InitializerPrior)
        assert zeus.auto_correlations_settings.check_for_convergence is True
        assert zeus.auto_correlations_settings.check_size == 100
        assert zeus.auto_correlations_settings.required_length == 50
        assert zeus.auto_correlations_settings.change_threshold == 0.01
        assert zeus.number_of_cores == 1
Пример #2
0
"""
__Search__

Below we use zeus to fit the lens model, using the model with start points as described above. See the Zeus docs
for a description of what the input parameters below do.
"""
search = af.Zeus(
    path_prefix=path.join("imaging", "searches"),
    name="Zeus",
    unique_tag=dataset_name,
    nwalkers=30,
    nsteps=200,
    initializer=af.InitializerBall(lower_limit=0.49, upper_limit=0.51),
    auto_correlations_settings=af.AutoCorrelationsSettings(
        check_for_convergence=True,
        check_size=100,
        required_length=50,
        change_threshold=0.01,
    ),
    tune=False,
    tolerance=0.05,
    patience=5,
    maxsteps=10000,
    mu=1.0,
    maxiter=10000,
    vectorize=False,
    check_walkers=True,
    shuffle_ensemble=True,
    light_mode=False,
    iterations_per_update=5000,
    number_of_cores=1,
)