CUQIpy 1.1.1.post0.dev90__py3-none-any.whl → 1.1.1.post0.dev104__py3-none-any.whl

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.

@@ -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
  cuqi/__init__.py,sha256=LsGilhl-hBLEn6Glt8S_l0OJzAA1sKit_rui8h-D-p0,488
2
2
  cuqi/_messages.py,sha256=fzEBrZT2kbmfecBBPm7spVu7yHdxGARQB4QzXhJbCJ0,415
3
- cuqi/_version.py,sha256=T4zJHk9GS-Zo_rUrR4df7lzaYMb3K6uUw1dTyP6i5F8,509
3
+ cuqi/_version.py,sha256=ev1lMV7FBU7ximlxPrmH8v64aQPwG_9KBUS924KIehM,510
4
4
  cuqi/config.py,sha256=wcYvz19wkeKW2EKCGIKJiTpWt5kdaxyt4imyRkvtTRA,526
5
5
  cuqi/diagnostics.py,sha256=5OrbJeqpynqRXOe5MtOKKhe7EAVdOEpHIqHnlMW9G_c,3029
6
6
  cuqi/array/__init__.py,sha256=-EeiaiWGNsE3twRS4dD814BIlfxEsNkTCZUc5gjOXb0,30
@@ -37,13 +37,13 @@ cuqi/experimental/__init__.py,sha256=vhZvyMX6rl8Y0haqCzGLPz6PSUKyu75XMQbeDHqTTrw
37
37
  cuqi/experimental/mcmc/__init__.py,sha256=1sn0U6Ep0x5zv2602og2DkV3Bs8hNFOiq7C3VcMimVw,4472
38
38
  cuqi/experimental/mcmc/_conjugate.py,sha256=VNPQkGity0mposcqxrx4UIeXm35EvJvZED4p2stffvA,9924
39
39
  cuqi/experimental/mcmc/_conjugate_approx.py,sha256=uEnY2ea9su5ivcNagyRAwpQP2gBY98sXU7N0y5hTADo,3653
40
- cuqi/experimental/mcmc/_cwmh.py,sha256=BQE7-4kbiC32TJ38rlVtfSQieoKBK5GDca3HCqHJ7zE,7135
40
+ cuqi/experimental/mcmc/_cwmh.py,sha256=50v3uZaWhlVnfrEB5-lB_7pn8QoUVBe-xWxKGKbmNHg,7234
41
41
  cuqi/experimental/mcmc/_direct.py,sha256=9pQS_2Qk2-ybt6m8WTfPoKetcxQ00WaTRN85-Z0FrBY,777
42
42
  cuqi/experimental/mcmc/_gibbs.py,sha256=a_Zr007F233R6A3CJ_0zlQppsQrVuX8-oWCbNJWJxmA,12745
43
- cuqi/experimental/mcmc/_hmc.py,sha256=h63KT0jYq86H541hQzhHHzuLEn7vrRE_2r1o1mTEcZo,19261
44
- cuqi/experimental/mcmc/_langevin_algorithm.py,sha256=GKC_mlix3si_3J8E6I58ozh3ErB0XPmHMjV7sFyKLEQ,8200
43
+ cuqi/experimental/mcmc/_hmc.py,sha256=UAPM9tGs8tneUcDiywXKEBNsKazQMLSjWsTemJ7QwnQ,19377
44
+ cuqi/experimental/mcmc/_langevin_algorithm.py,sha256=yNO7ABxmkixzcLG-lv57GOTyeTr7HwFs2DrrhuZW9OI,8398
45
45
  cuqi/experimental/mcmc/_laplace_approximation.py,sha256=rdiE3cMQFq6FLQcOQwPpuGIxrTAp3aoGPxMDSdeopV0,5688
46
- cuqi/experimental/mcmc/_mh.py,sha256=W5hOraHqfEW4_havtC9Ib2SinJtNV-NvxcOAENeTYUY,2841
46
+ cuqi/experimental/mcmc/_mh.py,sha256=MXo0ahXP4KGFkaY4HtvcBE-TMQzsMlTmLKzSvpz7drU,2941
47
47
  cuqi/experimental/mcmc/_pcn.py,sha256=wqJBZLuRFSwxihaI53tumAg6AWVuceLMOmXssTetd1A,3374
48
48
  cuqi/experimental/mcmc/_rto.py,sha256=OtzgiYCxDoTdXp7y4mkLa2upj74qadesoqHYpr11ZCg,10061
49
49
  cuqi/experimental/mcmc/_sampler.py,sha256=S7sY7ORAPz2d7lvUhCRSg1PCbC745YXn4KVIqRYAZtw,20040
@@ -85,8 +85,8 @@ cuqi/testproblem/_testproblem.py,sha256=x769LwwRdJdzIiZkcQUGb_5-vynNTNALXWKato7s
85
85
  cuqi/utilities/__init__.py,sha256=H7xpJe2UinjZftKvE2JuXtTi4DqtkR6uIezStAXwfGg,428
86
86
  cuqi/utilities/_get_python_variable_name.py,sha256=QwlBVj2koJRA8s8pWd554p7-ElcI7HUwY32HknaR92E,1827
87
87
  cuqi/utilities/_utilities.py,sha256=Jc4knn80vLoA7kgw9FzXwKVFGaNBOXiA9kgvltZU3Ao,11777
88
- CUQIpy-1.1.1.post0.dev90.dist-info/LICENSE,sha256=kJWRPrtRoQoZGXyyvu50Uc91X6_0XRaVfT0YZssicys,10799
89
- CUQIpy-1.1.1.post0.dev90.dist-info/METADATA,sha256=-Bz6Ib4nK13LCqO_7m0g81twfiggb13wfVF37W0Kqo4,18410
90
- CUQIpy-1.1.1.post0.dev90.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
91
- CUQIpy-1.1.1.post0.dev90.dist-info/top_level.txt,sha256=AgmgMc6TKfPPqbjV0kvAoCBN334i_Lwwojc7HE3ZwD0,5
92
- CUQIpy-1.1.1.post0.dev90.dist-info/RECORD,,
88
+ CUQIpy-1.1.1.post0.dev104.dist-info/LICENSE,sha256=kJWRPrtRoQoZGXyyvu50Uc91X6_0XRaVfT0YZssicys,10799
89
+ CUQIpy-1.1.1.post0.dev104.dist-info/METADATA,sha256=RgqKNls2VvX0uWaoVPhIqzcHi8FjSeaqXIhrWhHc72M,18411
90
+ CUQIpy-1.1.1.post0.dev104.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
91
+ CUQIpy-1.1.1.post0.dev104.dist-info/top_level.txt,sha256=AgmgMc6TKfPPqbjV0kvAoCBN334i_Lwwojc7HE3ZwD0,5
92
+ CUQIpy-1.1.1.post0.dev104.dist-info/RECORD,,
cuqi/_version.py CHANGED
@@ -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