CUQIpy 1.2.0.post0.dev481__py3-none-any.whl → 1.2.0.post0.dev501__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.
- {CUQIpy-1.2.0.post0.dev481.dist-info → CUQIpy-1.2.0.post0.dev501.dist-info}/METADATA +1 -1
- {CUQIpy-1.2.0.post0.dev481.dist-info → CUQIpy-1.2.0.post0.dev501.dist-info}/RECORD +9 -9
- cuqi/_version.py +3 -3
- cuqi/experimental/__init__.py +1 -1
- cuqi/experimental/algebra/_randomvariable.py +26 -0
- cuqi/solver/_solver.py +1 -1
- {CUQIpy-1.2.0.post0.dev481.dist-info → CUQIpy-1.2.0.post0.dev501.dist-info}/LICENSE +0 -0
- {CUQIpy-1.2.0.post0.dev481.dist-info → CUQIpy-1.2.0.post0.dev501.dist-info}/WHEEL +0 -0
- {CUQIpy-1.2.0.post0.dev481.dist-info → CUQIpy-1.2.0.post0.dev501.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: CUQIpy
|
|
3
|
-
Version: 1.2.0.post0.
|
|
3
|
+
Version: 1.2.0.post0.dev501
|
|
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
|
|
3
|
+
cuqi/_version.py,sha256=-wStiLQQiCB-PTnm1EIuY2Bqw9TKX4zIsPlS3OkQHg8,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
|
|
@@ -34,11 +34,11 @@ cuqi/distribution/_posterior.py,sha256=zAfL0GECxekZ2lBt1W6_LN0U_xskMwK4VNce5xAF7
|
|
|
34
34
|
cuqi/distribution/_smoothed_laplace.py,sha256=p-1Y23mYA9omwiHGkEuv3T2mwcPAAoNlCr7T8osNkjE,2925
|
|
35
35
|
cuqi/distribution/_truncated_normal.py,sha256=sZkLYgnkGOyS_3ZxY7iw6L62t-Jh6shzsweRsRepN2k,4240
|
|
36
36
|
cuqi/distribution/_uniform.py,sha256=KA8yQ6ZS3nQGS4PYJ4hpDg6Eq8EQKQvPsIpYfR8fj2w,1967
|
|
37
|
-
cuqi/experimental/__init__.py,sha256=
|
|
37
|
+
cuqi/experimental/__init__.py,sha256=bIQ9OroeitHbwgNe3wI_JvzkILK0N25Tt7wpquPoU3w,129
|
|
38
38
|
cuqi/experimental/algebra/__init__.py,sha256=btRAWG58ZfdtK0afXKOg60AX7d76KMBjlZa4AWBCCgU,81
|
|
39
39
|
cuqi/experimental/algebra/_ast.py,sha256=PdPz19cJMjvnMx4KEzhn4gvxIZX_UViE33Mbttj_5Xw,9873
|
|
40
40
|
cuqi/experimental/algebra/_orderedset.py,sha256=fKysh4pmI4xF7Y5Z6O86ABzg20o4uBs-v8jmLBMrdpo,2849
|
|
41
|
-
cuqi/experimental/algebra/_randomvariable.py,sha256=
|
|
41
|
+
cuqi/experimental/algebra/_randomvariable.py,sha256=isbFtIWsWXF-yF5Vb56nLy4MCkQM6akjd-dQau4wfbE,19725
|
|
42
42
|
cuqi/experimental/geometry/__init__.py,sha256=kgoKegfz3Jhr7fpORB_l55z9zLZRtloTLyXFDh1oF2o,47
|
|
43
43
|
cuqi/experimental/geometry/_productgeometry.py,sha256=G-hIYnfLiRS5IWD2EPXORNBKNP2zSaCCHAeBlDC_R3I,7177
|
|
44
44
|
cuqi/experimental/mcmc/__init__.py,sha256=zSqLZmxOqQ-F94C9-gPv7g89TX1XxlrlNm071Eb167I,4487
|
|
@@ -87,14 +87,14 @@ cuqi/sampler/_sampler.py,sha256=TkZ_WAS-5Q43oICa-Elc2gftsRTBd7PEDUMDZ9tTGmU,5712
|
|
|
87
87
|
cuqi/samples/__init__.py,sha256=vCs6lVk-pi8RBqa6cIN5wyn6u-K9oEf1Na4k1ZMrYv8,44
|
|
88
88
|
cuqi/samples/_samples.py,sha256=hUc8OnCF9CTCuDTrGHwwzv3wp8mG_6vsJAFvuQ-x0uA,35832
|
|
89
89
|
cuqi/solver/__init__.py,sha256=KYgAi_8VoAwljTB3S2I87YnJkRtedskLee7hQp_-zp8,220
|
|
90
|
-
cuqi/solver/_solver.py,sha256=
|
|
90
|
+
cuqi/solver/_solver.py,sha256=_Q47Atv8Ze6eMJzA22s0OzdW4lcDigRhbotnCzmrQWE,30662
|
|
91
91
|
cuqi/testproblem/__init__.py,sha256=DWTOcyuNHMbhEuuWlY5CkYkNDSAqhvsKmJXBLivyblU,202
|
|
92
92
|
cuqi/testproblem/_testproblem.py,sha256=x769LwwRdJdzIiZkcQUGb_5-vynNTNALXWKato7sS0Q,52540
|
|
93
93
|
cuqi/utilities/__init__.py,sha256=RB84VstmFcZgPOz58LKSzOvCVebbeKDcKl9MGk-EwoA,515
|
|
94
94
|
cuqi/utilities/_get_python_variable_name.py,sha256=wxpCaj9f3ZtBNqlGmmuGiITgBaTsY-r94lUIlK6UAU4,2043
|
|
95
95
|
cuqi/utilities/_utilities.py,sha256=gc9YAj7wFKzyZTE1H5iI_1Tt4AtjT1g5l1-zxBdH-Co,15281
|
|
96
|
-
CUQIpy-1.2.0.post0.
|
|
97
|
-
CUQIpy-1.2.0.post0.
|
|
98
|
-
CUQIpy-1.2.0.post0.
|
|
99
|
-
CUQIpy-1.2.0.post0.
|
|
100
|
-
CUQIpy-1.2.0.post0.
|
|
96
|
+
CUQIpy-1.2.0.post0.dev501.dist-info/LICENSE,sha256=kJWRPrtRoQoZGXyyvu50Uc91X6_0XRaVfT0YZssicys,10799
|
|
97
|
+
CUQIpy-1.2.0.post0.dev501.dist-info/METADATA,sha256=qAa9TTLdoTmo7L8fOcRrE_9sj6Sfk2z2DpfCY8eitD0,18529
|
|
98
|
+
CUQIpy-1.2.0.post0.dev501.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
99
|
+
CUQIpy-1.2.0.post0.dev501.dist-info/top_level.txt,sha256=AgmgMc6TKfPPqbjV0kvAoCBN334i_Lwwojc7HE3ZwD0,5
|
|
100
|
+
CUQIpy-1.2.0.post0.dev501.dist-info/RECORD,,
|
cuqi/_version.py
CHANGED
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "2025-01-
|
|
11
|
+
"date": "2025-01-30T19:07:50+0100",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "1.2.0.post0.
|
|
14
|
+
"full-revisionid": "ead079a625cad175f6a0159d46c90d7cdf80bc0f",
|
|
15
|
+
"version": "1.2.0.post0.dev501"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
cuqi/experimental/__init__.py
CHANGED
|
@@ -6,6 +6,8 @@ import operator
|
|
|
6
6
|
import cuqi
|
|
7
7
|
from cuqi.distribution import Distribution
|
|
8
8
|
from copy import copy, deepcopy
|
|
9
|
+
import numpy as np
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
class RandomVariable:
|
|
11
13
|
""" Random variable defined by a distribution with the option to apply algebraic operations on it.
|
|
@@ -165,6 +167,30 @@ class RandomVariable:
|
|
|
165
167
|
raise ValueError(f"Expected arguments {self.parameter_names}, got arguments {kwargs}")
|
|
166
168
|
|
|
167
169
|
return self.tree(**kwargs)
|
|
170
|
+
|
|
171
|
+
def sample(self, N=1):
|
|
172
|
+
""" Sample from the random variable.
|
|
173
|
+
|
|
174
|
+
Parameters
|
|
175
|
+
----------
|
|
176
|
+
N : int, optional
|
|
177
|
+
Number of samples to draw. Default is 1.
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
if self.is_cond:
|
|
181
|
+
raise NotImplementedError(
|
|
182
|
+
"Unable to directly sample from a random variable that has distributions with "
|
|
183
|
+
"conditioning variables. This is not implemented."
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
if N == 1: return self(**{dist.name: dist.sample() for dist in self.distributions})
|
|
187
|
+
|
|
188
|
+
samples = np.array([
|
|
189
|
+
self(**{dist.name: dist.sample() for dist in self.distributions})
|
|
190
|
+
for _ in range(N)
|
|
191
|
+
]).reshape(-1, N) # Ensure correct shape (dim, N)
|
|
192
|
+
|
|
193
|
+
return cuqi.samples.Samples(samples)
|
|
168
194
|
|
|
169
195
|
@property
|
|
170
196
|
def tree(self):
|
cuqi/solver/_solver.py
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|