CUQIpy 1.3.0.post0.dev58__tar.gz → 1.3.0.post0.dev70__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.
Potentially problematic release.
This version of CUQIpy might be problematic. Click here for more details.
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/CUQIpy.egg-info/PKG-INFO +3 -2
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/PKG-INFO +3 -2
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/_version.py +3 -3
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/__init__.py +1 -1
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_uniform.py +35 -1
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_distribution.py +13 -1
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_distributions_shape.py +1 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/CUQIpy.egg-info/SOURCES.txt +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/CUQIpy.egg-info/dependency_links.txt +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/CUQIpy.egg-info/requires.txt +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/CUQIpy.egg-info/top_level.txt +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/LICENSE +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/README.md +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/_messages.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/array/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/array/_array.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/config.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/data/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/data/_data.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/data/astronaut.npz +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/data/camera.npz +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/data/cat.npz +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/data/cookie.png +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/data/satellite.mat +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/density/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/density/_density.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/diagnostics.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_beta.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_cauchy.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_cmrf.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_custom.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_distribution.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_gamma.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_gaussian.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_gmrf.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_inverse_gamma.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_joint_distribution.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_laplace.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_lmrf.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_lognormal.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_modifiedhalfnormal.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_normal.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_posterior.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_smoothed_laplace.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_truncated_normal.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/algebra/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/algebra/_ast.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/algebra/_orderedset.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/algebra/_randomvariable.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/geometry/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/geometry/_productgeometry.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_conjugate.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_conjugate_approx.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_cwmh.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_direct.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_gibbs.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_hmc.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_langevin_algorithm.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_laplace_approximation.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_mh.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_pcn.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_rto.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_sampler.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_utilities.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/geometry/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/geometry/_geometry.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/implicitprior/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/implicitprior/_regularizedGMRF.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/implicitprior/_regularizedGaussian.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/implicitprior/_regularizedUnboundedUniform.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/implicitprior/_restorator.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/likelihood/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/likelihood/_likelihood.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/model/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/model/_model.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/operator/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/operator/_operator.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/pde/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/pde/_pde.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/problem/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/problem/_problem.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/sampler/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/sampler/_conjugate.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/sampler/_conjugate_approx.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/sampler/_cwmh.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/sampler/_gibbs.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/sampler/_hmc.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/sampler/_langevin_algorithm.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/sampler/_laplace_approximation.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/sampler/_mh.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/sampler/_pcn.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/sampler/_rto.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/sampler/_sampler.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/samples/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/samples/_samples.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/solver/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/solver/_solver.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/testproblem/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/testproblem/_testproblem.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/utilities/__init__.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/utilities/_get_python_variable_name.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/utilities/_utilities.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/pyproject.toml +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/requirements.txt +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/setup.cfg +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/setup.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_MRFs.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_abstract_distribution_density.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_bayesian_inversion.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_density.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_geometry.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_implicit_priors.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_joint_distribution.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_likelihood.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_model.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_pde.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_posterior.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_problem.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_sampler.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_samples.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_solver.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_testproblem.py +0 -0
- {cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/tests/test_utilities.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: CUQIpy
|
|
3
|
-
Version: 1.3.0.post0.
|
|
3
|
+
Version: 1.3.0.post0.dev70
|
|
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
|
|
@@ -205,6 +205,7 @@ Requires-Dist: numpy>=1.17.0
|
|
|
205
205
|
Requires-Dist: scipy<1.13
|
|
206
206
|
Requires-Dist: arviz
|
|
207
207
|
Requires-Dist: tqdm
|
|
208
|
+
Dynamic: license-file
|
|
208
209
|
|
|
209
210
|
<div align="center">
|
|
210
211
|
<img src="https://cuqi-dtu.github.io/CUQIpy/_static/logo.png" alt="CUQIpy logo" width="250"/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: CUQIpy
|
|
3
|
-
Version: 1.3.0.post0.
|
|
3
|
+
Version: 1.3.0.post0.dev70
|
|
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
|
|
@@ -205,6 +205,7 @@ Requires-Dist: numpy>=1.17.0
|
|
|
205
205
|
Requires-Dist: scipy<1.13
|
|
206
206
|
Requires-Dist: arviz
|
|
207
207
|
Requires-Dist: tqdm
|
|
208
|
+
Dynamic: license-file
|
|
208
209
|
|
|
209
210
|
<div align="center">
|
|
210
211
|
<img src="https://cuqi-dtu.github.io/CUQIpy/_static/logo.png" alt="CUQIpy logo" width="250"/>
|
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "2025-
|
|
11
|
+
"date": "2025-04-10T10:13:59+0200",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "1.3.0.post0.
|
|
14
|
+
"full-revisionid": "c18048b15c6ec1a66e8e4bc097e0180fc3d4e47e",
|
|
15
|
+
"version": "1.3.0.post0.dev70"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
|
@@ -14,6 +14,6 @@ from ._lognormal import Lognormal
|
|
|
14
14
|
from ._normal import Normal
|
|
15
15
|
from ._truncated_normal import TruncatedNormal
|
|
16
16
|
from ._posterior import Posterior
|
|
17
|
-
from ._uniform import Uniform
|
|
17
|
+
from ._uniform import Uniform, UnboundedUniform
|
|
18
18
|
from ._custom import UserDefinedDistribution, DistributionGallery
|
|
19
19
|
from ._joint_distribution import JointDistribution, _StackedJointDistribution, MultipleLikelihoodPosterior
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import numpy as np
|
|
2
2
|
from cuqi.distribution import Distribution
|
|
3
|
+
from cuqi.geometry import Geometry
|
|
3
4
|
|
|
4
5
|
class Uniform(Distribution):
|
|
5
6
|
|
|
@@ -57,4 +58,37 @@ class Uniform(Distribution):
|
|
|
57
58
|
else:
|
|
58
59
|
s = np.random.uniform(self.low, self.high, (N,self.dim)).T
|
|
59
60
|
|
|
60
|
-
return s
|
|
61
|
+
return s
|
|
62
|
+
|
|
63
|
+
class UnboundedUniform(Distribution):
|
|
64
|
+
"""
|
|
65
|
+
Unbounded uniform distribution. This is a special case of the
|
|
66
|
+
Uniform distribution, where the lower and upper bounds are set to
|
|
67
|
+
-inf and inf, respectively. This distribution is not normalizable,
|
|
68
|
+
and therefore cannot be sampled from. It is mainly used for
|
|
69
|
+
initializing non-informative priors.
|
|
70
|
+
Parameters
|
|
71
|
+
----------
|
|
72
|
+
geometry : int or Geometry
|
|
73
|
+
The geometry of the distribution. If an integer is given, it is
|
|
74
|
+
interpreted as the dimension of the distribution. If a
|
|
75
|
+
Geometry object is given, its par_dim attribute is used.
|
|
76
|
+
"""
|
|
77
|
+
def __init__(self, geometry, is_symmetric=True, **kwargs):
|
|
78
|
+
super().__init__(geometry=geometry, is_symmetric=is_symmetric, **kwargs)
|
|
79
|
+
|
|
80
|
+
def logpdf(self, x):
|
|
81
|
+
"""
|
|
82
|
+
Evaluate the logarithm of the unnormalized PDF at the given values of x.
|
|
83
|
+
"""
|
|
84
|
+
# Always return 1.0 (the unnormalized log PDF)
|
|
85
|
+
return 1.0
|
|
86
|
+
|
|
87
|
+
def gradient(self, x):
|
|
88
|
+
"""
|
|
89
|
+
Computes the gradient of logpdf at the given values of x.
|
|
90
|
+
"""
|
|
91
|
+
return np.zeros_like(x)
|
|
92
|
+
|
|
93
|
+
def _sample(self, N=1, rng=None):
|
|
94
|
+
raise NotImplementedError("Cannot sample from UnboundedUniform distribution")
|
|
@@ -203,7 +203,6 @@ def test_Uniform_logpdf(low, high, toeval, expected):
|
|
|
203
203
|
UD = cuqi.distribution.Uniform(low, high)
|
|
204
204
|
assert np.allclose(UD.logpdf(toeval), expected)
|
|
205
205
|
|
|
206
|
-
|
|
207
206
|
@pytest.mark.parametrize("low,high,expected",[(np.array([1, .5]),
|
|
208
207
|
np.array([2, 2.5]),
|
|
209
208
|
np.array([[1.5507979 , 1.29090474, 1.89294695],
|
|
@@ -217,6 +216,19 @@ def test_Uniform_sample(low, high, expected):
|
|
|
217
216
|
print(cuqi_samples)
|
|
218
217
|
assert np.allclose(cuqi_samples.samples, expected)
|
|
219
218
|
|
|
219
|
+
def test_UnboundedUniform_logpdf_and_gradient():
|
|
220
|
+
x1 = cuqi.distribution.UnboundedUniform(geometry=1)
|
|
221
|
+
assert np.allclose(x1.logpdf(np.array([1])), 1.0)
|
|
222
|
+
assert np.allclose(x1.gradient(np.array([0])), np.array([0]))
|
|
223
|
+
x2 = cuqi.distribution.UnboundedUniform(geometry=cuqi.geometry.Discrete(2))
|
|
224
|
+
assert np.allclose(x2.logpdf(np.array([1, 2])), 1.0)
|
|
225
|
+
assert np.allclose(x2.gradient(np.array([0, 0])), np.array([0, 0]))
|
|
226
|
+
|
|
227
|
+
def test_UnboundedUniform_sample():
|
|
228
|
+
x = cuqi.distribution.UnboundedUniform(geometry=2)
|
|
229
|
+
with pytest.raises(NotImplementedError, match="Cannot sample from UnboundedUniform distribution"):
|
|
230
|
+
x.sample()
|
|
231
|
+
|
|
220
232
|
@pytest.mark.parametrize("distribution, kwargs",
|
|
221
233
|
[(cuqi.distribution.Uniform,
|
|
222
234
|
{'low':np.array([2, 2.5, 3,5]),
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_joint_distribution.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_modifiedhalfnormal.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_smoothed_laplace.py
RENAMED
|
File without changes
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/distribution/_truncated_normal.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/algebra/_orderedset.py
RENAMED
|
File without changes
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/algebra/_randomvariable.py
RENAMED
|
File without changes
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/geometry/__init__.py
RENAMED
|
File without changes
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/geometry/_productgeometry.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_conjugate_approx.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/experimental/mcmc/_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
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/implicitprior/_regularizedGMRF.py
RENAMED
|
File without changes
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/cuqi/implicitprior/_regularizedGaussian.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
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/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
|
|
File without changes
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/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
|
|
File without changes
|
{cuqipy-1.3.0.post0.dev58 → cuqipy-1.3.0.post0.dev70}/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
|