CUQIpy 0.8.0.post0.dev89__tar.gz → 0.8.0.post0.dev92__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-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/CUQIpy.egg-info/PKG-INFO +1 -1
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/PKG-INFO +1 -1
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/_version.py +3 -3
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_beta.py +1 -1
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_distribution.py +25 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/CUQIpy.egg-info/SOURCES.txt +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/CUQIpy.egg-info/dependency_links.txt +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/CUQIpy.egg-info/requires.txt +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/CUQIpy.egg-info/top_level.txt +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/LICENSE +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/README.md +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/_messages.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/array/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/array/_array.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/config.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/data/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/data/_data.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/data/astronaut.npz +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/data/camera.npz +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/data/cat.npz +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/data/cookie.png +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/data/satellite.mat +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/density/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/density/_density.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/diagnostics.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_cauchy.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_cmrf.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_custom.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_distribution.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_gamma.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_gaussian.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_gmrf.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_inverse_gamma.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_joint_distribution.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_laplace.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_lmrf.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_lognormal.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_normal.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_posterior.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_uniform.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/geometry/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/geometry/_geometry.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/implicitprior/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/implicitprior/_regularizedGMRF.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/implicitprior/_regularizedGaussian.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/likelihood/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/likelihood/_likelihood.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/model/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/model/_model.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/operator/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/operator/_operator.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/pde/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/pde/_pde.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/problem/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/problem/_problem.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/sampler/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/sampler/_conjugate.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/sampler/_conjugate_approx.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/sampler/_cwmh.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/sampler/_gibbs.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/sampler/_hmc.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/sampler/_langevin_algorithm.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/sampler/_laplace_approximation.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/sampler/_mh.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/sampler/_pcn.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/sampler/_rto.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/sampler/_sampler.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/samples/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/samples/_samples.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/solver/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/solver/_solver.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/testproblem/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/testproblem/_testproblem.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/utilities/__init__.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/utilities/_get_python_variable_name.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/utilities/_utilities.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/pyproject.toml +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/requirements.txt +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/setup.cfg +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/setup.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_MRFs.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_abstract_distribution_density.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_bayesian_inversion.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_density.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_distributions_shape.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_geometry.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_implicit_priors.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_joint_distribution.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_likelihood.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_model.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_pde.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_posterior.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_problem.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_sampler.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_samples.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_solver.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_testproblem.py +0 -0
- {CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/tests/test_utilities.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: CUQIpy
|
|
3
|
-
Version: 0.8.0.post0.
|
|
3
|
+
Version: 0.8.0.post0.dev92
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: CUQIpy
|
|
3
|
-
Version: 0.8.0.post0.
|
|
3
|
+
Version: 0.8.0.post0.dev92
|
|
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": "2024-02-
|
|
11
|
+
"date": "2024-02-19T05:04:22+0100",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "0.8.0.post0.
|
|
14
|
+
"full-revisionid": "f274c4a7b3044d1ba3e9567bb167a1cdbea05283",
|
|
15
|
+
"version": "0.8.0.post0.dev92"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
|
@@ -69,7 +69,7 @@ class Beta(Distribution):
|
|
|
69
69
|
def _sample(self, N=1, rng=None):
|
|
70
70
|
return sps.beta.rvs(a=self.alpha, b=self.beta, size=(N,self.dim), random_state=rng).T
|
|
71
71
|
|
|
72
|
-
def _gradient(self, x):
|
|
72
|
+
def _gradient(self, x, *args, **kwargs):
|
|
73
73
|
#Avoid complicated geometries that change the gradient.
|
|
74
74
|
if not type(self.geometry) in _get_identity_geometries():
|
|
75
75
|
raise NotImplementedError("Gradient not implemented for distribution {} with geometry {}".format(self,self.geometry))
|
|
@@ -589,6 +589,31 @@ def test_beta(): #TODO. Make more tests
|
|
|
589
589
|
FD_gradient = cuqi.utilities.approx_gradient(BD.logpdf, x, epsilon=0.000000001)
|
|
590
590
|
assert np.allclose(BD.gradient(x),FD_gradient,rtol=1e-3) or (np.all(np.isnan(FD_gradient)) and np.all(np.isnan(BD.gradient(x))))
|
|
591
591
|
|
|
592
|
+
# Fixture for beta distribution where beta is a likelihood
|
|
593
|
+
@pytest.fixture
|
|
594
|
+
def beta_likelihood():
|
|
595
|
+
# simple forward model
|
|
596
|
+
A = cuqi.model.Model(
|
|
597
|
+
lambda x: x**2,
|
|
598
|
+
range_geometry=1,
|
|
599
|
+
domain_geometry=1,
|
|
600
|
+
gradient=lambda direction, wrt: 2*wrt*direction)
|
|
601
|
+
|
|
602
|
+
# set a gaussian prior
|
|
603
|
+
x = cuqi.distribution.Gaussian(0, 1)
|
|
604
|
+
# Beta data distribution
|
|
605
|
+
y = cuqi.distribution.Beta(A(x),1)
|
|
606
|
+
# set the observed data
|
|
607
|
+
y=y(y=0.5)
|
|
608
|
+
return y
|
|
609
|
+
|
|
610
|
+
def test_gradient_for_Beta_as_likelihood_raises_error(beta_likelihood):
|
|
611
|
+
"""Test computing the gradient of the Beta distribution as a likelihood
|
|
612
|
+
raises a NotImplementedError"""
|
|
613
|
+
|
|
614
|
+
with pytest.raises(NotImplementedError,
|
|
615
|
+
match=r"Gradient is not implemented for CUQI Beta."):
|
|
616
|
+
beta_likelihood.gradient(1)
|
|
592
617
|
|
|
593
618
|
@pytest.mark.parametrize("C",[1, np.ones(5), np.eye(5), sps.eye(5), sps.diags(np.ones(5))])
|
|
594
619
|
def test_Gaussian_Cov_sample(C):
|
|
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-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/distribution/_joint_distribution.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-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/cuqi/implicitprior/_regularizedGMRF.py
RENAMED
|
File without changes
|
{CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/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
|
{CUQIpy-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/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-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/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-0.8.0.post0.dev89 → CUQIpy-0.8.0.post0.dev92}/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
|