CUQIpy 1.4.0.post0.dev101__tar.gz → 1.4.0.post0.dev116__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/CUQIpy.egg-info/PKG-INFO +1 -1
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/CUQIpy.egg-info/SOURCES.txt +1 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/PKG-INFO +1 -1
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/_version.py +3 -3
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/config.py +6 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/problem/_problem.py +2 -2
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/sampler/_sampler.py +19 -4
- cuqipy-1.4.0.post0.dev116/tests/test_config.py +13 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/CUQIpy.egg-info/dependency_links.txt +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/CUQIpy.egg-info/requires.txt +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/CUQIpy.egg-info/top_level.txt +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/LICENSE +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/README.md +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/_messages.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/algebra/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/algebra/_abstract_syntax_tree.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/algebra/_ordered_set.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/algebra/_random_variable.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/array/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/array/_array.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/data/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/data/_data.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/data/astronaut.npz +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/data/camera.npz +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/data/cat.npz +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/data/cookie.png +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/data/satellite.mat +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/density/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/density/_density.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/diagnostics.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_beta.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_cauchy.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_cmrf.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_custom.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_distribution.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_gamma.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_gaussian.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_gmrf.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_inverse_gamma.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_joint_distribution.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_laplace.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_lmrf.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_lognormal.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_modified_half_normal.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_normal.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_posterior.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_smoothed_laplace.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_truncated_normal.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_uniform.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/experimental/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/experimental/_recommender.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/geometry/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/geometry/_geometry.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/geometry/_product_geometry.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/implicitprior/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/implicitprior/_regularized_gaussian.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/implicitprior/_regularized_gmrf.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/implicitprior/_regularized_unbounded_uniform.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/implicitprior/_restorator.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/sampler/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/sampler/_conjugate.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/sampler/_conjugate_approx.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/sampler/_cwmh.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/sampler/_gibbs.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/sampler/_hmc.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/sampler/_langevin_algorithm.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/sampler/_laplace_approximation.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/sampler/_mh.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/sampler/_pcn.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/sampler/_rto.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/sampler/_sampler.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/likelihood/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/likelihood/_likelihood.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/model/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/model/_model.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/operator/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/operator/_operator.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/pde/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/pde/_observation_map.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/pde/_pde.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/problem/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/sampler/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/sampler/_conjugate.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/sampler/_conjugate_approx.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/sampler/_cwmh.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/sampler/_direct.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/sampler/_gibbs.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/sampler/_hmc.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/sampler/_langevin_algorithm.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/sampler/_laplace_approximation.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/sampler/_mh.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/sampler/_pcn.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/sampler/_rto.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/samples/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/samples/_samples.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/solver/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/solver/_solver.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/testproblem/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/testproblem/_testproblem.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/utilities/__init__.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/utilities/_get_python_variable_name.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/utilities/_utilities.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/pyproject.toml +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/requirements.txt +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/setup.cfg +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/setup.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_abstract_distribution_density.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_algebra.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_bayesian_inversion.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_density.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_distribution.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_distributions_shape.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_geometry.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_implicit_priors.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_joint_distribution.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_legacy_sampler.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_likelihood.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_model.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_mrfs.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_pde.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_posterior.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_problem.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_product_geometry.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_random_variable.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_samples.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_solver.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_testproblem.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_utilities.py +0 -0
- {cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_z_mcmc.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: CUQIpy
|
|
3
|
-
Version: 1.4.0.post0.
|
|
3
|
+
Version: 1.4.0.post0.dev116
|
|
4
4
|
Summary: Computational Uncertainty Quantification for Inverse problems in Python
|
|
5
5
|
Maintainer-email: "Nicolai A. B. Riis" <nabr@dtu.dk>, "Jakob S. Jørgensen" <jakj@dtu.dk>, "Amal M. Alghamdi" <amaal@dtu.dk>, Chao Zhang <chaz@dtu.dk>
|
|
6
6
|
License: Apache License
|
|
@@ -107,6 +107,7 @@ cuqi/utilities/_utilities.py
|
|
|
107
107
|
tests/test_abstract_distribution_density.py
|
|
108
108
|
tests/test_algebra.py
|
|
109
109
|
tests/test_bayesian_inversion.py
|
|
110
|
+
tests/test_config.py
|
|
110
111
|
tests/test_density.py
|
|
111
112
|
tests/test_distribution.py
|
|
112
113
|
tests/test_distributions_shape.py
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: CUQIpy
|
|
3
|
-
Version: 1.4.0.post0.
|
|
3
|
+
Version: 1.4.0.post0.dev116
|
|
4
4
|
Summary: Computational Uncertainty Quantification for Inverse problems in Python
|
|
5
5
|
Maintainer-email: "Nicolai A. B. Riis" <nabr@dtu.dk>, "Jakob S. Jørgensen" <jakj@dtu.dk>, "Amal M. Alghamdi" <amaal@dtu.dk>, Chao Zhang <chaz@dtu.dk>
|
|
6
6
|
License: Apache License
|
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "2025-
|
|
11
|
+
"date": "2025-12-04T09:30:08+0100",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "1.4.0.post0.
|
|
14
|
+
"full-revisionid": "a37a0584e43394251680ac4288e8df89f5ebb023",
|
|
15
|
+
"version": "1.4.0.post0.dev116"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
|
@@ -12,3 +12,9 @@ MAX_STACK_SEARCH_DEPTH = 1000
|
|
|
12
12
|
|
|
13
13
|
MIN_DIM_SPARSE = 75
|
|
14
14
|
""" Minimum dimension to start storing Nd-arrays as sparse for N>2. The minimum dimension is defined as MIN_DIM_SPARSE^N. """
|
|
15
|
+
|
|
16
|
+
PROGRESS_BAR_DYNAMIC_UPDATE = True
|
|
17
|
+
""" If True, progress bars are updated frequently (dynamic updates).
|
|
18
|
+
If False, progress bars are minimal/static (only shown at start and end),
|
|
19
|
+
which is useful, for example, when building documentation or the Jupyter book (CUQI-Book)
|
|
20
|
+
"""
|
|
@@ -330,9 +330,9 @@ class BayesianProblem(object):
|
|
|
330
330
|
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
|
|
331
331
|
print("")
|
|
332
332
|
|
|
333
|
-
if
|
|
333
|
+
if legacy:
|
|
334
334
|
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
|
|
335
|
-
print("
|
|
335
|
+
print("!! Using legacy samplers from cuqi.legacy.sampler !!")
|
|
336
336
|
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
|
|
337
337
|
print("")
|
|
338
338
|
|
|
@@ -5,6 +5,7 @@ import pickle as pkl
|
|
|
5
5
|
import warnings
|
|
6
6
|
import cuqi
|
|
7
7
|
from cuqi.samples import Samples
|
|
8
|
+
from cuqi import config
|
|
8
9
|
|
|
9
10
|
try:
|
|
10
11
|
from tqdm import tqdm
|
|
@@ -228,6 +229,7 @@ class Sampler(ABC):
|
|
|
228
229
|
batch_handler = _BatchHandler(batch_size, sample_path)
|
|
229
230
|
|
|
230
231
|
# Draw samples
|
|
232
|
+
acc_rate = 0.0
|
|
231
233
|
pbar = tqdm(range(Ns), "Sample: ")
|
|
232
234
|
for idx in pbar:
|
|
233
235
|
|
|
@@ -239,8 +241,10 @@ class Sampler(ABC):
|
|
|
239
241
|
if (Nt > 0) and (idx % Nt == 0):
|
|
240
242
|
self._samples.append(self.current_point)
|
|
241
243
|
|
|
242
|
-
#
|
|
243
|
-
|
|
244
|
+
# Display acc rate at progress bar
|
|
245
|
+
acc_rate = np.mean(self._acc[-1-idx:])
|
|
246
|
+
if config.PROGRESS_BAR_DYNAMIC_UPDATE:
|
|
247
|
+
pbar.set_postfix_str(f"acc rate: {acc_rate:.2%}")
|
|
244
248
|
|
|
245
249
|
# Add sample to batch
|
|
246
250
|
if batch_size > 0:
|
|
@@ -248,6 +252,10 @@ class Sampler(ABC):
|
|
|
248
252
|
|
|
249
253
|
# Call callback function if specified
|
|
250
254
|
self._call_callback(idx, Ns)
|
|
255
|
+
|
|
256
|
+
# Finalize progress bar printing
|
|
257
|
+
if not config.PROGRESS_BAR_DYNAMIC_UPDATE:
|
|
258
|
+
print(f"Sampling acceptance rate: {acc_rate:.2%}\n")
|
|
251
259
|
|
|
252
260
|
return self
|
|
253
261
|
|
|
@@ -273,6 +281,7 @@ class Sampler(ABC):
|
|
|
273
281
|
tune_interval = max(int(tune_freq * Nb), 1)
|
|
274
282
|
|
|
275
283
|
# Draw warmup samples with tuning
|
|
284
|
+
acc_rate = 0.0
|
|
276
285
|
pbar = tqdm(range(Nb), "Warmup: ")
|
|
277
286
|
for idx in pbar:
|
|
278
287
|
|
|
@@ -288,12 +297,18 @@ class Sampler(ABC):
|
|
|
288
297
|
if (Nt > 0) and (idx % Nt == 0):
|
|
289
298
|
self._samples.append(self.current_point)
|
|
290
299
|
|
|
291
|
-
#
|
|
292
|
-
|
|
300
|
+
# Display acc rate at progress bar
|
|
301
|
+
acc_rate = np.mean(self._acc[-1-idx:])
|
|
302
|
+
if config.PROGRESS_BAR_DYNAMIC_UPDATE:
|
|
303
|
+
pbar.set_postfix_str(f"acc rate: {acc_rate:.2%}")
|
|
293
304
|
|
|
294
305
|
# Call callback function if specified
|
|
295
306
|
self._call_callback(idx, Nb)
|
|
296
307
|
|
|
308
|
+
# Finalize progress bar printing
|
|
309
|
+
if not config.PROGRESS_BAR_DYNAMIC_UPDATE:
|
|
310
|
+
print(f"Warmup acceptance rate: {acc_rate:.2%}\n")
|
|
311
|
+
|
|
297
312
|
return self
|
|
298
313
|
|
|
299
314
|
def get_state(self) -> dict:
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import cuqi
|
|
2
|
+
|
|
3
|
+
def test_progress_bar_update_frequently_default():
|
|
4
|
+
"""Config exposes PROGRESS_BAR_DYNAMIC_UPDATE and it is a boolean."""
|
|
5
|
+
assert hasattr(cuqi, "config")
|
|
6
|
+
assert isinstance(cuqi.config.PROGRESS_BAR_DYNAMIC_UPDATE, bool)
|
|
7
|
+
|
|
8
|
+
def test_progress_bar_update_frequently_toggle(monkeypatch):
|
|
9
|
+
"""Can toggle PROGRESS_BAR_DYNAMIC_UPDATE via monkeypatch."""
|
|
10
|
+
original = cuqi.config.PROGRESS_BAR_DYNAMIC_UPDATE
|
|
11
|
+
monkeypatch.setattr(cuqi.config, "PROGRESS_BAR_DYNAMIC_UPDATE", not original, raising=True)
|
|
12
|
+
assert cuqi.config.PROGRESS_BAR_DYNAMIC_UPDATE == (not original)
|
|
13
|
+
# monkeypatch will restore the original value after the test
|
{cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/CUQIpy.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/algebra/_abstract_syntax_tree.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_joint_distribution.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_modified_half_normal.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_smoothed_laplace.py
RENAMED
|
File without changes
|
{cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/distribution/_truncated_normal.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/implicitprior/_regularized_gaussian.py
RENAMED
|
File without changes
|
{cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/implicitprior/_regularized_gmrf.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/sampler/_conjugate_approx.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/legacy/sampler/_langevin_algorithm.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/sampler/_laplace_approximation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/cuqi/utilities/_get_python_variable_name.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.4.0.post0.dev101 → cuqipy-1.4.0.post0.dev116}/tests/test_abstract_distribution_density.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|