pygeoinf 1.2.7__tar.gz → 1.2.8__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.
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/PKG-INFO +8 -15
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/README.md +7 -14
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/__init__.py +9 -1
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/gaussian_measure.py +24 -35
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/linear_operators.py +659 -173
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/linear_solvers.py +39 -7
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/random_matrix.py +114 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pyproject.toml +3 -14
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/LICENSE +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/backus_gilbert.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/checks/hilbert_space.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/checks/linear_operators.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/checks/nonlinear_operators.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/direct_sum.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/forward_problem.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/hilbert_space.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/inversion.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/linear_bayesian.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/linear_forms.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/linear_optimisation.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/nonlinear_forms.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/nonlinear_operators.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/nonlinear_optimisation.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/parallel.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/symmetric_space/__init__.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/symmetric_space/circle.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/symmetric_space/sphere.py +0 -0
- {pygeoinf-1.2.7 → pygeoinf-1.2.8}/pygeoinf/symmetric_space/symmetric_space.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pygeoinf
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.8
|
|
4
4
|
Summary: A package for solving geophysical inference and inverse problems
|
|
5
5
|
License: BSD-3-Clause
|
|
6
6
|
Author: David Al-Attar and Dan Heathcote
|
|
@@ -64,22 +64,15 @@ git clone https://github.com/da380/pygeoinf.git
|
|
|
64
64
|
cd pygeoinf
|
|
65
65
|
poetry install
|
|
66
66
|
```
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
You can install all optional dependencies for development—including tools for running the test suite,
|
|
68
|
+
building the documentation, and running the Jupyter tutorials—by using the ```--with``` flag and specifying the ```dev``` group.
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
|
-
#
|
|
72
|
-
poetry install --with
|
|
73
|
-
|
|
74
|
-
# To install dependencies for building the documentation
|
|
75
|
-
poetry install --with docs
|
|
71
|
+
# Install all development dependencies (for tests, docs, and tutorials)
|
|
72
|
+
poetry install --with dev
|
|
73
|
+
```
|
|
76
74
|
|
|
77
|
-
# To install dependencies for running the Jupyter tutorials
|
|
78
|
-
poetry install --with tutorials
|
|
79
75
|
|
|
80
|
-
# You can also combine them
|
|
81
|
-
poetry install --with tests,docs,tutorials
|
|
82
|
-
```
|
|
83
76
|
|
|
84
77
|
## Documentation
|
|
85
78
|
|
|
@@ -245,9 +238,9 @@ The output of the above script will look similar to the following figure:
|
|
|
245
238
|
|
|
246
239
|
## Future Plans
|
|
247
240
|
|
|
248
|
-
`pygeoinf` is under active development.
|
|
241
|
+
`pygeoinf` is under active development. Current work is focused on expanding the library's capabilities to address a broader range of geophysical problems. Key areas for development include:
|
|
249
242
|
|
|
250
|
-
* **Generalised Backus-Gilbert Methods**: Implementation of a generalised Backus-Gilbert framework for linear inference problems
|
|
243
|
+
* **Generalised Backus-Gilbert Methods**: Implementation of a generalised Backus-Gilbert framework for linear inference problems. The focus will be on constructing direct estimates of specific properties of interest (i.e., linear functionals of the model) from data, without needing to first solve for the full model itself.
|
|
251
244
|
|
|
252
245
|
* **Non-linear Optimisation**: Extension of the current optimisation framework to handle non-linear inverse problems. This will involve creating a general interface where users can provide their own non-linear forward mapping, a misfit functional, and methods for computing gradients (and optionally Hessians) for use in gradient-based optimisation algorithms.
|
|
253
246
|
|
|
@@ -43,22 +43,15 @@ git clone https://github.com/da380/pygeoinf.git
|
|
|
43
43
|
cd pygeoinf
|
|
44
44
|
poetry install
|
|
45
45
|
```
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
You can install all optional dependencies for development—including tools for running the test suite,
|
|
47
|
+
building the documentation, and running the Jupyter tutorials—by using the ```--with``` flag and specifying the ```dev``` group.
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
-
#
|
|
51
|
-
poetry install --with
|
|
52
|
-
|
|
53
|
-
# To install dependencies for building the documentation
|
|
54
|
-
poetry install --with docs
|
|
50
|
+
# Install all development dependencies (for tests, docs, and tutorials)
|
|
51
|
+
poetry install --with dev
|
|
52
|
+
```
|
|
55
53
|
|
|
56
|
-
# To install dependencies for running the Jupyter tutorials
|
|
57
|
-
poetry install --with tutorials
|
|
58
54
|
|
|
59
|
-
# You can also combine them
|
|
60
|
-
poetry install --with tests,docs,tutorials
|
|
61
|
-
```
|
|
62
55
|
|
|
63
56
|
## Documentation
|
|
64
57
|
|
|
@@ -224,9 +217,9 @@ The output of the above script will look similar to the following figure:
|
|
|
224
217
|
|
|
225
218
|
## Future Plans
|
|
226
219
|
|
|
227
|
-
`pygeoinf` is under active development.
|
|
220
|
+
`pygeoinf` is under active development. Current work is focused on expanding the library's capabilities to address a broader range of geophysical problems. Key areas for development include:
|
|
228
221
|
|
|
229
|
-
* **Generalised Backus-Gilbert Methods**: Implementation of a generalised Backus-Gilbert framework for linear inference problems
|
|
222
|
+
* **Generalised Backus-Gilbert Methods**: Implementation of a generalised Backus-Gilbert framework for linear inference problems. The focus will be on constructing direct estimates of specific properties of interest (i.e., linear functionals of the model) from data, without needing to first solve for the full model itself.
|
|
230
223
|
|
|
231
224
|
* **Non-linear Optimisation**: Extension of the current optimisation framework to handle non-linear inverse problems. This will involve creating a general interface where users can provide their own non-linear forward mapping, a misfit functional, and methods for computing gradients (and optionally Hessians) for use in gradient-based optimisation algorithms.
|
|
232
225
|
|
|
@@ -9,6 +9,7 @@ from .random_matrix import (
|
|
|
9
9
|
random_svd,
|
|
10
10
|
random_eig,
|
|
11
11
|
random_cholesky,
|
|
12
|
+
random_diagonal,
|
|
12
13
|
)
|
|
13
14
|
|
|
14
15
|
from .hilbert_space import (
|
|
@@ -32,7 +33,14 @@ from .linear_forms import (
|
|
|
32
33
|
|
|
33
34
|
from .nonlinear_operators import NonLinearOperator
|
|
34
35
|
|
|
35
|
-
from .linear_operators import
|
|
36
|
+
from .linear_operators import (
|
|
37
|
+
LinearOperator,
|
|
38
|
+
MatrixLinearOperator,
|
|
39
|
+
DenseMatrixLinearOperator,
|
|
40
|
+
SparseMatrixLinearOperator,
|
|
41
|
+
DiagonalSparseMatrixLinearOperator,
|
|
42
|
+
NormalSumOperator,
|
|
43
|
+
)
|
|
36
44
|
|
|
37
45
|
|
|
38
46
|
from .gaussian_measure import (
|
|
@@ -28,11 +28,11 @@ from scipy.sparse import diags
|
|
|
28
28
|
from scipy.stats import multivariate_normal
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
from .hilbert_space import EuclideanSpace, HilbertModule
|
|
31
|
+
from .hilbert_space import EuclideanSpace, HilbertModule, Vector
|
|
32
32
|
|
|
33
33
|
from .linear_operators import (
|
|
34
34
|
LinearOperator,
|
|
35
|
-
|
|
35
|
+
DiagonalSparseMatrixLinearOperator,
|
|
36
36
|
)
|
|
37
37
|
|
|
38
38
|
from .direct_sum import (
|
|
@@ -40,17 +40,6 @@ from .direct_sum import (
|
|
|
40
40
|
)
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
# This block only runs for type checkers, not at runtime, to prevent
|
|
44
|
-
# circular import errors while still allowing type hints.
|
|
45
|
-
if TYPE_CHECKING:
|
|
46
|
-
from .hilbert_space import HilbertSpace, EuclideanSpace
|
|
47
|
-
from .operators import LinearOperator, DiagonalLinearOperator
|
|
48
|
-
from .direct_sum import BlockDiagonalLinearOperator
|
|
49
|
-
|
|
50
|
-
# Define a generic type for vectors in a Hilbert space
|
|
51
|
-
Vector = TypeVar("Vector")
|
|
52
|
-
|
|
53
|
-
|
|
54
43
|
class GaussianMeasure:
|
|
55
44
|
"""
|
|
56
45
|
Represents a Gaussian measure on a Hilbert space.
|
|
@@ -76,29 +65,29 @@ class GaussianMeasure:
|
|
|
76
65
|
inverse_covariance_factor: LinearOperator = None,
|
|
77
66
|
) -> None:
|
|
78
67
|
"""
|
|
79
|
-
|
|
68
|
+
Initializes the GaussianMeasure.
|
|
80
69
|
|
|
81
70
|
The measure can be defined in several ways, primarily by providing
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
71
|
+
either a covariance operator or a covariance factor.
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
covariance (LinearOperator, optional): A self-adjoint and positive
|
|
75
|
+
semi-definite linear operator on the domain.
|
|
76
|
+
covariance_factor (LinearOperator, optional): A linear operator L
|
|
77
|
+
such that the covariance C = L @ L*.
|
|
78
|
+
expectation (vector, optional): The expectation (mean) of the
|
|
79
|
+
measure. Defaults to the zero vector of the space.
|
|
80
|
+
sample (callable, optional): A function that returns a random
|
|
81
|
+
sample from the measure. If a `covariance_factor` is given,
|
|
82
|
+
a default sampler is created.
|
|
83
|
+
inverse_covariance (LinearOperator, optional): The inverse of the
|
|
84
|
+
covariance operator (the precision operator).
|
|
85
|
+
inverse_covariance_factor (LinearOperator, optional): A factor Li
|
|
86
|
+
of the inverse covariance, such that C_inv = Li.T @ Li.
|
|
87
|
+
|
|
88
|
+
Raises:
|
|
89
|
+
ValueError: If neither `covariance` nor `covariance_factor`
|
|
90
|
+
is provided.
|
|
102
91
|
"""
|
|
103
92
|
if covariance is None and covariance_factor is None:
|
|
104
93
|
raise ValueError(
|
|
@@ -186,7 +175,7 @@ class GaussianMeasure:
|
|
|
186
175
|
"Standard deviation vector does not have the correct length"
|
|
187
176
|
)
|
|
188
177
|
euclidean = EuclideanSpace(domain.dim)
|
|
189
|
-
covariance_factor =
|
|
178
|
+
covariance_factor = DiagonalSparseMatrixLinearOperator.from_diagonal_values(
|
|
190
179
|
euclidean, domain, standard_deviations
|
|
191
180
|
)
|
|
192
181
|
return GaussianMeasure(
|