Skip to content

Commit 484e59d

Browse files
authored
Merge pull request #1151 from rhayes777/feature/model_centered
Feature/model centered
2 parents 5e2fac9 + 1890370 commit 484e59d

91 files changed

Lines changed: 2204 additions & 955 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

autofit/__init__.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
from autoconf.dictable import register_parser
2+
from . import conf
3+
4+
conf.instance.register(__file__)
5+
16
import abc
27
import pickle
3-
48
from dill import register
59

6-
from autoconf.dictable import register_parser
7-
from .non_linear.grid.grid_search import GridSearch as SearchGridSearch
8-
from . import conf
910
from . import exc
1011
from . import mock as m
12+
from .non_linear.grid.grid_search import GridSearch as SearchGridSearch
1113
from .aggregator.base import AggBase
1214
from .database.aggregator.aggregator import GridSearchAggregator
1315
from .graphical.expectation_propagation.history import EPHistory
@@ -54,6 +56,7 @@
5456
from .mapper.prior import GaussianPrior
5557
from .mapper.prior import LogGaussianPrior
5658
from .mapper.prior import LogUniformPrior
59+
from .mapper.prior import TruncatedGaussianPrior
5760
from .mapper.prior.abstract import Prior
5861
from .mapper.prior.tuple_prior import TuplePrior
5962
from .mapper.prior import UniformPrior
@@ -136,6 +139,6 @@ def save_abc(pickler, obj):
136139
pickle._Pickler.save_type(pickler, obj)
137140

138141

139-
conf.instance.register(__file__)
142+
140143

141144
__version__ = "2025.5.10.1"

autofit/config/general.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
jax:
2+
use_jax: false # If True, PyAutoFit uses JAX internally, whereas False uses normal Numpy.
13
analysis:
24
n_cores: 1 # The number of cores a parallelized sum of Analysis classes uses by default.
35
hpc:
46
hpc_mode: false # If True, use HPC mode, which disables GUI visualization, logging to screen and other settings which are not suited to running on a super computer.
57
iterations_per_update: 5000 # The number of iterations between every update (visualization, results output, etc) in HPC mode.
68
inversion:
79
check_reconstruction: true # If True, the inversion's reconstruction is checked to ensure the solution of a meshs's mapper is not an invalid solution where the values are all the same.
8-
reconstruction_vmax_factor: 0.5 # Plots of an Inversion's reconstruction use the reconstructed data's bright value multiplied by this factor.
9-
model:
10-
ignore_prior_limits: false # If ``True`` the limits applied to priors will be ignored, where limits set upper / lower limits. This stops PriorLimitException's from being raised.
10+
reconstruction_vmax_factor: 0.5 # Plots of an Inversion's reconstruction use the reconstructed data's bright value multiplied by this factor.
1111
output:
1212
force_pickle_overwrite: false # If True pickle files output by a search (e.g. samples.pickle) are recreated when a new model-fit is performed.
1313
force_visualize_overwrite: false # If True, visualization images output by a search (e.g. subplots of the fit) are recreated when a new model-fit is performed.

autofit/config/priors/Exponential.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
centre:
2-
gaussian_limits:
2+
limits:
33
lower: -inf
44
upper: inf
55
lower_limit: 0.0
@@ -9,7 +9,7 @@ centre:
99
type: Absolute
1010
value: 20.0
1111
normalization:
12-
gaussian_limits:
12+
limits:
1313
lower: 0.0
1414
upper: inf
1515
lower_limit: 1.0e-06
@@ -19,7 +19,7 @@ normalization:
1919
type: Relative
2020
value: 0.5
2121
rate:
22-
gaussian_limits:
22+
limits:
2323
lower: 0.0
2424
upper: inf
2525
lower_limit: 0.0

autofit/config/priors/Gaussian.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
centre:
2-
gaussian_limits:
2+
limits:
33
lower: -inf
44
upper: inf
55
lower_limit: 0.0
@@ -9,7 +9,7 @@ centre:
99
type: Absolute
1010
value: 20.0
1111
normalization:
12-
gaussian_limits:
12+
limits:
1313
lower: 0.0
1414
upper: inf
1515
lower_limit: 1.0e-06
@@ -19,7 +19,7 @@ normalization:
1919
type: Relative
2020
value: 0.5
2121
sigma:
22-
gaussian_limits:
22+
limits:
2323
lower: 0.0
2424
upper: inf
2525
lower_limit: 0.0

autofit/config/priors/Gaussian2D.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
centre_0:
2-
gaussian_limits:
2+
limits:
33
lower: -inf
44
upper: inf
55
lower_limit: 0.0
@@ -9,7 +9,7 @@ centre_0:
99
type: Absolute
1010
value: 20.0
1111
centre_1:
12-
gaussian_limits:
12+
limits:
1313
lower: -inf
1414
upper: inf
1515
lower_limit: 0.0
@@ -19,7 +19,7 @@ centre_1:
1919
type: Absolute
2020
value: 20.0
2121
normalization:
22-
gaussian_limits:
22+
limits:
2323
lower: 0.0
2424
upper: inf
2525
lower_limit: 1.0e-06
@@ -29,7 +29,7 @@ normalization:
2929
type: Relative
3030
value: 0.5
3131
sigma:
32-
gaussian_limits:
32+
limits:
3333
lower: 0.0
3434
upper: inf
3535
lower_limit: 0.0

autofit/config/priors/GaussianKurtosis.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
GaussianPrior:
2-
lower_limit:
3-
type: Constant
4-
value: -inf
5-
upper_limit:
6-
type: Constant
7-
value: inf
81
centre:
9-
gaussian_limits:
2+
limits:
103
lower: -inf
114
upper: inf
125
lower_limit: 0.0
@@ -16,7 +9,7 @@ centre:
169
type: Absolute
1710
value: 20.0
1811
kurtosis:
19-
gaussian_limits:
12+
limits:
2013
lower: -inf
2114
upper: inf
2215
lower_limit: 0.0
@@ -26,7 +19,7 @@ kurtosis:
2619
type: Absolute
2720
value: 20.0
2821
normalization:
29-
gaussian_limits:
22+
limits:
3023
lower: 0.0
3124
upper: inf
3225
lower_limit: 1.0e-06
@@ -36,7 +29,7 @@ normalization:
3629
type: Relative
3730
value: 0.5
3831
sigma:
39-
gaussian_limits:
32+
limits:
4033
lower: 0.0
4134
upper: inf
4235
lower_limit: 0.0

autofit/config/priors/MultiLevelGaussians.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
higher_level_centre:
2-
gaussian_limits:
2+
limits:
33
lower: -inf
44
upper: inf
55
lower_limit: 0.0

autofit/config/priors/README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ They appear as follows:
1313
width_modifier:
1414
type: Absolute
1515
value: 20.0
16-
gaussian_limits:
16+
limits:
1717
lower: -inf
1818
upper: inf
1919
@@ -28,9 +28,9 @@ The sections of this example config set the following:
2828
When the results of a search are passed to a subsequent search to set up the priors of its non-linear search,
2929
this entry describes how the Prior is passed. For a full description of prior passing, checkout the examples
3030
in 'autolens_workspace/examples/complex/linking'.
31-
gaussian_limits
31+
limits
3232
When the results of a search are passed to a subsequent search, they are passed using a GaussianPrior. The
33-
gaussian_limits set the physical lower and upper limits of this GaussianPrior, such that parameter samples
33+
limits set the physical lower and upper limits of this GaussianPrior, such that parameter samples
3434
can not go beyond these limits.
3535

3636
The files ``template_module.yaml`` and ``TemplateObject.yaml`` give templates one can use to set up prior default

autofit/config/priors/model.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Exponential:
22
centre:
3-
gaussian_limits:
3+
limits:
44
lower: -inf
55
upper: inf
66
lower_limit: 0.0
@@ -10,7 +10,7 @@ Exponential:
1010
type: Absolute
1111
value: 20.0
1212
normalization:
13-
gaussian_limits:
13+
limits:
1414
lower: 0.0
1515
upper: inf
1616
lower_limit: 1.0e-06
@@ -20,7 +20,7 @@ Exponential:
2020
type: Relative
2121
value: 0.5
2222
rate:
23-
gaussian_limits:
23+
limits:
2424
lower: 0.0
2525
upper: inf
2626
lower_limit: 0.0
@@ -31,7 +31,7 @@ Exponential:
3131
value: 0.5
3232
Gaussian:
3333
centre:
34-
gaussian_limits:
34+
limits:
3535
lower: -inf
3636
upper: inf
3737
lower_limit: 0.0
@@ -41,7 +41,7 @@ Gaussian:
4141
type: Absolute
4242
value: 20.0
4343
normalization:
44-
gaussian_limits:
44+
limits:
4545
lower: 0.0
4646
upper: inf
4747
lower_limit: 1.0e-06
@@ -51,7 +51,7 @@ Gaussian:
5151
type: Relative
5252
value: 0.5
5353
sigma:
54-
gaussian_limits:
54+
limits:
5555
lower: 0.0
5656
upper: inf
5757
lower_limit: 0.0

autofit/config/priors/profiles.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Exponential:
22
centre:
3-
gaussian_limits:
3+
limits:
44
lower: -inf
55
upper: inf
66
lower_limit: 0.0
@@ -10,7 +10,7 @@ Exponential:
1010
type: Absolute
1111
value: 20.0
1212
normalization:
13-
gaussian_limits:
13+
limits:
1414
lower: 0.0
1515
upper: inf
1616
lower_limit: 1.0e-06
@@ -20,7 +20,7 @@ Exponential:
2020
type: Relative
2121
value: 0.5
2222
rate:
23-
gaussian_limits:
23+
limits:
2424
lower: 0.0
2525
upper: inf
2626
lower_limit: 0.0
@@ -31,7 +31,7 @@ Exponential:
3131
value: 0.5
3232
Gaussian:
3333
centre:
34-
gaussian_limits:
34+
limits:
3535
lower: -inf
3636
upper: inf
3737
lower_limit: 0.0
@@ -41,7 +41,7 @@ Gaussian:
4141
type: Absolute
4242
value: 20.0
4343
normalization:
44-
gaussian_limits:
44+
limits:
4545
lower: 0.0
4646
upper: inf
4747
lower_limit: 1.0e-06
@@ -51,7 +51,7 @@ Gaussian:
5151
type: Relative
5252
value: 0.5
5353
sigma:
54-
gaussian_limits:
54+
limits:
5555
lower: 0.0
5656
upper: inf
5757
lower_limit: 0.0

0 commit comments

Comments
 (0)