CUQIpy 1.1.1.post0.dev90__tar.gz → 1.1.1.post0.dev104__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.

Files changed (118) hide show
  1. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/CUQIpy.egg-info/PKG-INFO +1 -1
  2. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/PKG-INFO +1 -1
  3. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/_version.py +3 -3
  4. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/mcmc/_cwmh.py +3 -1
  5. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/mcmc/_hmc.py +4 -1
  6. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/mcmc/_langevin_algorithm.py +11 -5
  7. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/mcmc/_mh.py +3 -1
  8. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/CUQIpy.egg-info/SOURCES.txt +0 -0
  9. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/CUQIpy.egg-info/dependency_links.txt +0 -0
  10. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/CUQIpy.egg-info/requires.txt +0 -0
  11. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/CUQIpy.egg-info/top_level.txt +0 -0
  12. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/LICENSE +0 -0
  13. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/README.md +0 -0
  14. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/__init__.py +0 -0
  15. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/_messages.py +0 -0
  16. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/array/__init__.py +0 -0
  17. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/array/_array.py +0 -0
  18. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/config.py +0 -0
  19. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/data/__init__.py +0 -0
  20. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/data/_data.py +0 -0
  21. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/data/astronaut.npz +0 -0
  22. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/data/camera.npz +0 -0
  23. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/data/cat.npz +0 -0
  24. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/data/cookie.png +0 -0
  25. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/data/satellite.mat +0 -0
  26. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/density/__init__.py +0 -0
  27. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/density/_density.py +0 -0
  28. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/diagnostics.py +0 -0
  29. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/__init__.py +0 -0
  30. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_beta.py +0 -0
  31. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_cauchy.py +0 -0
  32. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_cmrf.py +0 -0
  33. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_custom.py +0 -0
  34. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_distribution.py +0 -0
  35. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_gamma.py +0 -0
  36. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_gaussian.py +0 -0
  37. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_gmrf.py +0 -0
  38. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_inverse_gamma.py +0 -0
  39. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_joint_distribution.py +0 -0
  40. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_laplace.py +0 -0
  41. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_lmrf.py +0 -0
  42. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_lognormal.py +0 -0
  43. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_modifiedhalfnormal.py +0 -0
  44. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_normal.py +0 -0
  45. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_posterior.py +0 -0
  46. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_smoothed_laplace.py +0 -0
  47. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/distribution/_uniform.py +0 -0
  48. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/__init__.py +0 -0
  49. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/mcmc/__init__.py +0 -0
  50. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/mcmc/_conjugate.py +0 -0
  51. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/mcmc/_conjugate_approx.py +0 -0
  52. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/mcmc/_direct.py +0 -0
  53. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/mcmc/_gibbs.py +0 -0
  54. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/mcmc/_laplace_approximation.py +0 -0
  55. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/mcmc/_pcn.py +0 -0
  56. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/mcmc/_rto.py +0 -0
  57. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/mcmc/_sampler.py +0 -0
  58. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/experimental/mcmc/_utilities.py +0 -0
  59. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/geometry/__init__.py +0 -0
  60. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/geometry/_geometry.py +0 -0
  61. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/implicitprior/__init__.py +0 -0
  62. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/implicitprior/_regularizedGMRF.py +0 -0
  63. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/implicitprior/_regularizedGaussian.py +0 -0
  64. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/implicitprior/_regularizedUnboundedUniform.py +0 -0
  65. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/likelihood/__init__.py +0 -0
  66. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/likelihood/_likelihood.py +0 -0
  67. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/model/__init__.py +0 -0
  68. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/model/_model.py +0 -0
  69. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/operator/__init__.py +0 -0
  70. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/operator/_operator.py +0 -0
  71. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/pde/__init__.py +0 -0
  72. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/pde/_pde.py +0 -0
  73. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/problem/__init__.py +0 -0
  74. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/problem/_problem.py +0 -0
  75. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/sampler/__init__.py +0 -0
  76. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/sampler/_conjugate.py +0 -0
  77. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/sampler/_conjugate_approx.py +0 -0
  78. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/sampler/_cwmh.py +0 -0
  79. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/sampler/_gibbs.py +0 -0
  80. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/sampler/_hmc.py +0 -0
  81. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/sampler/_langevin_algorithm.py +0 -0
  82. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/sampler/_laplace_approximation.py +0 -0
  83. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/sampler/_mh.py +0 -0
  84. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/sampler/_pcn.py +0 -0
  85. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/sampler/_rto.py +0 -0
  86. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/sampler/_sampler.py +0 -0
  87. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/samples/__init__.py +0 -0
  88. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/samples/_samples.py +0 -0
  89. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/solver/__init__.py +0 -0
  90. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/solver/_solver.py +0 -0
  91. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/testproblem/__init__.py +0 -0
  92. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/testproblem/_testproblem.py +0 -0
  93. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/utilities/__init__.py +0 -0
  94. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/utilities/_get_python_variable_name.py +0 -0
  95. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/cuqi/utilities/_utilities.py +0 -0
  96. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/pyproject.toml +0 -0
  97. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/requirements.txt +0 -0
  98. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/setup.cfg +0 -0
  99. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/setup.py +0 -0
  100. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_MRFs.py +0 -0
  101. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_abstract_distribution_density.py +0 -0
  102. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_bayesian_inversion.py +0 -0
  103. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_density.py +0 -0
  104. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_distribution.py +0 -0
  105. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_distributions_shape.py +0 -0
  106. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_geometry.py +0 -0
  107. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_implicit_priors.py +0 -0
  108. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_joint_distribution.py +0 -0
  109. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_likelihood.py +0 -0
  110. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_model.py +0 -0
  111. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_pde.py +0 -0
  112. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_posterior.py +0 -0
  113. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_problem.py +0 -0
  114. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_sampler.py +0 -0
  115. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_samples.py +0 -0
  116. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_solver.py +0 -0
  117. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_testproblem.py +0 -0
  118. {cuqipy-1.1.1.post0.dev90 → cuqipy-1.1.1.post0.dev104}/tests/test_utilities.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: CUQIpy
3
- Version: 1.1.1.post0.dev90
3
+ Version: 1.1.1.post0.dev104
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: 1.1.1.post0.dev90
3
+ Version: 1.1.1.post0.dev104
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-09-13T08:36:06+0200",
11
+ "date": "2024-09-13T10:02:02+0200",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "22a43b19a36622c11b96970eff2e8ab6776a7142",
15
- "version": "1.1.1.post0.dev90"
14
+ "full-revisionid": "59ae0d0a693ec03a3282cffb9dc148e0729b3468",
15
+ "version": "1.1.1.post0.dev104"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -158,7 +158,9 @@ class CWMH(ProposalBasedSampler):
158
158
 
159
159
  # accept/reject
160
160
  u_theta = np.log(np.random.rand())
161
- if (u_theta <= alpha): # accept
161
+ if (u_theta <= alpha) and \
162
+ (not np.isnan(target_eval_star)) and \
163
+ (not np.isinf(target_eval_star)):
162
164
  x_t[j] = x_all_components[j]
163
165
  target_eval_t = target_eval_star
164
166
  acc[j] = 1
@@ -256,7 +256,10 @@ class NUTS(Sampler):
256
256
 
257
257
  # Metropolis step
258
258
  alpha2 = min(1, (n_prime/n)) #min(0, np.log(n_p) - np.log(n))
259
- if (s_prime == 1) and (np.random.rand() <= alpha2):
259
+ if (s_prime == 1) and \
260
+ (np.random.rand() <= alpha2) and \
261
+ (not np.isnan(logd_prime)) and \
262
+ (not np.isinf(logd_prime)):
260
263
  self.current_point = point_prime
261
264
  self.current_target_logd = logd_prime
262
265
  self.current_target_grad = np.copy(grad_prime)
@@ -102,10 +102,14 @@ class ULA(Sampler): # Refactor to Proposal-based sampler?
102
102
  scalar
103
103
  1 (accepted)
104
104
  """
105
- self.current_point = x_star
106
- self.current_target_logd = target_eval_star
107
- self.current_target_grad = target_grad_star
108
- acc = 1
105
+ acc = 0
106
+ if (not np.isnan(target_eval_star)) and \
107
+ (not np.isinf(target_eval_star)):
108
+ self.current_point = x_star
109
+ self.current_target_logd = target_eval_star
110
+ self.current_target_grad = target_grad_star
111
+ acc = 1
112
+
109
113
  return acc
110
114
 
111
115
  def step(self):
@@ -211,7 +215,9 @@ class MALA(ULA): # Refactor to Proposal-based sampler?
211
215
  # accept/reject with Metropolis
212
216
  acc = 0
213
217
  log_u = np.log(np.random.rand())
214
- if (log_u <= log_alpha) and (np.isnan(target_eval_star) == False):
218
+ if (log_u <= log_alpha) and \
219
+ (not np.isnan(target_eval_star)) and \
220
+ (not np.isinf(target_eval_star)):
215
221
  self.current_point = x_star
216
222
  self.current_target_logd = target_eval_star
217
223
  self.current_target_grad = target_grad_star
@@ -57,7 +57,9 @@ class MH(ProposalBasedSampler):
57
57
  # accept/reject
58
58
  u_theta = np.log(np.random.rand())
59
59
  acc = 0
60
- if (u_theta <= alpha):
60
+ if (u_theta <= alpha) and \
61
+ (not np.isnan(target_eval_star)) and \
62
+ (not np.isinf(target_eval_star)):
61
63
  self.current_point = x_star
62
64
  self.current_target_logd = target_eval_star
63
65
  acc = 1