Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d464d15
switchign use jax to config enables tests to pass
Jun 19, 2025
783a002
simplify use jax import and make jax requirmeent
Jun 20, 2025
b0e3dd9
disable warning when jax is used
Jun 20, 2025
c454b94
simplify factor jax use
Jun 20, 2025
1e12b7f
simplify jacobians
Jun 20, 2025
37e74bc
move more jax imports
Jun 20, 2025
7adc630
fix pool and erfinv imports for cleaner JAX support
Jun 20, 2025
a7bcebc
all unit tests pass due to JAX fixes
Jun 20, 2025
4f793e7
docstring of normal message complete
Jun 20, 2025
bbb00e7
beta.py docstringed
Jun 20, 2025
71e11f7
GaussianPrior updated
Jun 20, 2025
36aa2ed
removed lower_limit and upper_limit from GaussianPrior
Jun 20, 2025
7655911
remove lower_limit from all messages
Jun 20, 2025
304890b
remove limits from test_limits
Jun 20, 2025
5d85b80
remove all use of PriorLimitException
Jun 20, 2025
30d4703
remove assert_within_limits
Jun 20, 2025
0af923c
remove ignore_prior_limits
Jun 20, 2025
4b91631
limits removed rom mapping
Jun 20, 2025
2b392eb
cleaning up some tests
Jun 20, 2025
61c6179
more removal of stuff trying to ix unit tests
Jun 20, 2025
1d736b8
remove limits from more priors
Jun 20, 2025
5abfff9
identifier tests pass
Jun 20, 2025
6b97918
aggregator tests pass
Jun 20, 2025
ce38e33
remove lower limits of gaussians from more unit test sertup
Jun 20, 2025
7a9d7fe
reinstate __database_args__ in UniformPrior and LogUniformPrior
Jun 20, 2025
dd77edf
remove tests on gaussiaPrior limits being copied
Jun 20, 2025
3cc518f
fix random prior test
Jun 20, 2025
858bf83
add dict to UniformPrior and LogUniformPRior fixint tests lost via in…
Jun 20, 2025
9ca1533
all prior tests pass
Jun 20, 2025
3da4c5a
fix non linear test regression by putting assertion skip back in
Jun 23, 2025
8bfa958
readd limits to priors for prior passing
Jun 23, 2025
0a94820
fix mapper model test regression
Jun 23, 2025
6286348
pytest test_autofit/mapper/model/test_model_mapper.py
Jun 23, 2025
b1a4cd4
fix test_autofit/mapper/functionality/test_take_attributes.py
Jun 23, 2025
1894d07
test_autofit/jax/test_pytrees.py
Jun 23, 2025
7e558f6
fix test_autofit/graphical/test_unification.py
Jun 23, 2025
c3d0aef
fix test_autofit/graphical/stochastic/test_regression.py
Jun 23, 2025
354ddb8
test_autofit/graphical/regression/test_identifier.py
Jun 23, 2025
559c141
fixtest_autofit/graphical/global/test_hierarchical.py
Jun 23, 2025
1d0c226
test_autofit/graphical/gaussian/test_other_priors.py
Jun 23, 2025
6673d99
test_autofit/database/identifier/test_identifiers.py
Jun 23, 2025
49e04de
fix pytest test_autofit/aggregator/test_reference.py
Jun 23, 2025
faee773
TruncatedNormal setup
Jun 23, 2025
4281ec8
value for on truncated gaussian
Jun 23, 2025
b17abf4
TruncatedGaussianPrior full implemented, removes assert within limits…
Jun 23, 2025
172b1ff
gaussian liimts -> limits
Jun 23, 2025
2b077c6
Merge branch 'main' into feature/truncated_gaussian
Jun 23, 2025
1d0efb0
integration tests pass
Jun 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions autofit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from autoconf.dictable import register_parser
from . import conf

conf.instance.register(__file__)

import abc
import pickle

from dill import register

from autoconf.dictable import register_parser
from .non_linear.grid.grid_search import GridSearch as SearchGridSearch
from . import conf
from . import exc
from . import mock as m
from .non_linear.grid.grid_search import GridSearch as SearchGridSearch
from .aggregator.base import AggBase
from .database.aggregator.aggregator import GridSearchAggregator
from .graphical.expectation_propagation.history import EPHistory
Expand Down Expand Up @@ -54,6 +56,7 @@
from .mapper.prior import GaussianPrior
from .mapper.prior import LogGaussianPrior
from .mapper.prior import LogUniformPrior
from .mapper.prior import TruncatedGaussianPrior
from .mapper.prior.abstract import Prior
from .mapper.prior.tuple_prior import TuplePrior
from .mapper.prior import UniformPrior
Expand Down Expand Up @@ -136,6 +139,6 @@ def save_abc(pickler, obj):
pickle._Pickler.save_type(pickler, obj)


conf.instance.register(__file__)


__version__ = "2025.5.10.1"
6 changes: 3 additions & 3 deletions autofit/config/general.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
jax:
use_jax: false # If True, PyAutoFit uses JAX internally, whereas False uses normal Numpy.
analysis:
n_cores: 1 # The number of cores a parallelized sum of Analysis classes uses by default.
hpc:
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.
iterations_per_update: 5000 # The number of iterations between every update (visualization, results output, etc) in HPC mode.
inversion:
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.
reconstruction_vmax_factor: 0.5 # Plots of an Inversion's reconstruction use the reconstructed data's bright value multiplied by this factor.
model:
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.
reconstruction_vmax_factor: 0.5 # Plots of an Inversion's reconstruction use the reconstructed data's bright value multiplied by this factor.
output:
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.
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.
Expand Down
6 changes: 3 additions & 3 deletions autofit/config/priors/Exponential.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
centre:
gaussian_limits:
limits:
lower: -inf
upper: inf
lower_limit: 0.0
Expand All @@ -9,7 +9,7 @@ centre:
type: Absolute
value: 20.0
normalization:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 1.0e-06
Expand All @@ -19,7 +19,7 @@ normalization:
type: Relative
value: 0.5
rate:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 0.0
Expand Down
6 changes: 3 additions & 3 deletions autofit/config/priors/Gaussian.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
centre:
gaussian_limits:
limits:
lower: -inf
upper: inf
lower_limit: 0.0
Expand All @@ -9,7 +9,7 @@ centre:
type: Absolute
value: 20.0
normalization:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 1.0e-06
Expand All @@ -19,7 +19,7 @@ normalization:
type: Relative
value: 0.5
sigma:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 0.0
Expand Down
8 changes: 4 additions & 4 deletions autofit/config/priors/Gaussian2D.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
centre_0:
gaussian_limits:
limits:
lower: -inf
upper: inf
lower_limit: 0.0
Expand All @@ -9,7 +9,7 @@ centre_0:
type: Absolute
value: 20.0
centre_1:
gaussian_limits:
limits:
lower: -inf
upper: inf
lower_limit: 0.0
Expand All @@ -19,7 +19,7 @@ centre_1:
type: Absolute
value: 20.0
normalization:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 1.0e-06
Expand All @@ -29,7 +29,7 @@ normalization:
type: Relative
value: 0.5
sigma:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 0.0
Expand Down
15 changes: 4 additions & 11 deletions autofit/config/priors/GaussianKurtosis.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
GaussianPrior:
lower_limit:
type: Constant
value: -inf
upper_limit:
type: Constant
value: inf
centre:
gaussian_limits:
limits:
lower: -inf
upper: inf
lower_limit: 0.0
Expand All @@ -16,7 +9,7 @@ centre:
type: Absolute
value: 20.0
kurtosis:
gaussian_limits:
limits:
lower: -inf
upper: inf
lower_limit: 0.0
Expand All @@ -26,7 +19,7 @@ kurtosis:
type: Absolute
value: 20.0
normalization:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 1.0e-06
Expand All @@ -36,7 +29,7 @@ normalization:
type: Relative
value: 0.5
sigma:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 0.0
Expand Down
2 changes: 1 addition & 1 deletion autofit/config/priors/MultiLevelGaussians.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
higher_level_centre:
gaussian_limits:
limits:
lower: -inf
upper: inf
lower_limit: 0.0
Expand Down
6 changes: 3 additions & 3 deletions autofit/config/priors/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ They appear as follows:
width_modifier:
type: Absolute
value: 20.0
gaussian_limits:
limits:
lower: -inf
upper: inf

Expand All @@ -28,9 +28,9 @@ The sections of this example config set the following:
When the results of a search are passed to a subsequent search to set up the priors of its non-linear search,
this entry describes how the Prior is passed. For a full description of prior passing, checkout the examples
in 'autolens_workspace/examples/complex/linking'.
gaussian_limits
limits
When the results of a search are passed to a subsequent search, they are passed using a GaussianPrior. The
gaussian_limits set the physical lower and upper limits of this GaussianPrior, such that parameter samples
limits set the physical lower and upper limits of this GaussianPrior, such that parameter samples
can not go beyond these limits.

The files ``template_module.yaml`` and ``TemplateObject.yaml`` give templates one can use to set up prior default
Expand Down
12 changes: 6 additions & 6 deletions autofit/config/priors/model.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Exponential:
centre:
gaussian_limits:
limits:
lower: -inf
upper: inf
lower_limit: 0.0
Expand All @@ -10,7 +10,7 @@ Exponential:
type: Absolute
value: 20.0
normalization:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 1.0e-06
Expand All @@ -20,7 +20,7 @@ Exponential:
type: Relative
value: 0.5
rate:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 0.0
Expand All @@ -31,7 +31,7 @@ Exponential:
value: 0.5
Gaussian:
centre:
gaussian_limits:
limits:
lower: -inf
upper: inf
lower_limit: 0.0
Expand All @@ -41,7 +41,7 @@ Gaussian:
type: Absolute
value: 20.0
normalization:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 1.0e-06
Expand All @@ -51,7 +51,7 @@ Gaussian:
type: Relative
value: 0.5
sigma:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 0.0
Expand Down
12 changes: 6 additions & 6 deletions autofit/config/priors/profiles.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Exponential:
centre:
gaussian_limits:
limits:
lower: -inf
upper: inf
lower_limit: 0.0
Expand All @@ -10,7 +10,7 @@ Exponential:
type: Absolute
value: 20.0
normalization:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 1.0e-06
Expand All @@ -20,7 +20,7 @@ Exponential:
type: Relative
value: 0.5
rate:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 0.0
Expand All @@ -31,7 +31,7 @@ Exponential:
value: 0.5
Gaussian:
centre:
gaussian_limits:
limits:
lower: -inf
upper: inf
lower_limit: 0.0
Expand All @@ -41,7 +41,7 @@ Gaussian:
type: Absolute
value: 20.0
normalization:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 1.0e-06
Expand All @@ -51,7 +51,7 @@ Gaussian:
type: Relative
value: 0.5
sigma:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 0.0
Expand Down
12 changes: 6 additions & 6 deletions autofit/config/priors/template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ModelComponent0:
parameter0:
gaussian_limits:
limits:
lower: -inf
upper: inf
lower_limit: 0.0
Expand All @@ -10,7 +10,7 @@ ModelComponent0:
type: Absolute
value: 20.0
parameter1:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 1.0e-06
Expand All @@ -20,7 +20,7 @@ ModelComponent0:
type: Relative
value: 0.5
parameter2:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 0.0
Expand All @@ -31,7 +31,7 @@ ModelComponent0:
value: 0.5
ModelComponent1:
parameter0:
gaussian_limits:
limits:
lower: -inf
upper: inf
lower_limit: 0.0
Expand All @@ -41,7 +41,7 @@ ModelComponent1:
type: Absolute
value: 20.0
parameter1:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 1.0e-06
Expand All @@ -51,7 +51,7 @@ ModelComponent1:
type: Relative
value: 0.5
parameter2:
gaussian_limits:
limits:
lower: 0.0
upper: inf
lower_limit: 0.0
Expand Down
1 change: 1 addition & 0 deletions autofit/database/model/prior.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class Prior(Object):
def _from_object(cls, model: abstract.Prior):
instance = cls()
instance.cls = type(model)
print(model.__database_args__)
instance._add_children(
[(key, getattr(model, key)) for key in model.__database_args__]
)
Expand Down
4 changes: 0 additions & 4 deletions autofit/exc.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ class FitException(Exception):
pass


class PriorLimitException(FitException, PriorException):
pass


class PipelineException(Exception):
pass

Expand Down
Loading
Loading