You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
:alt:A diagram showing current pysensors capabilities.
29
+
:figclass:align-center
24
30
25
31
Reconstruction
26
32
^^^^^^^^^^^^^^
@@ -43,12 +49,18 @@ feed them to a ``SSPOR`` instance with 10 sensors, and
43
49
model = pysensors.reconstruction.SSPOR(n_sensors=10)
44
50
model.fit(data)
45
51
46
-
Use the ``predict`` method to reconstruct a new function sampled at the chosen sensor locations:
52
+
Use the ``predict`` method to reconstruct a new function sampled at the chosen sensor locations. There are two methods of reconstruction using ``predict``: ``Unregularized Reconstruction`` and ``Regularized Reconstruction``.
53
+
47
54
48
55
.. code-block:: python
49
56
50
57
f = numpy.abs(x[model.selected_sensors]**2-0.5)
51
-
f_pred = model.predict(f)
58
+
# Unregularized reconstruction can be used using the method ``unregularized``
See `reconstruction comparison example <https://python-sensors.readthedocs.io/en/latest/examples/reconstruction_comparison.html>`__ for more information on the methods of reconstruction.
52
64
53
65
.. figure:: docs/figures/vandermonde.png
54
66
:align:center
@@ -77,6 +89,8 @@ Three strategies to deal with constraints are currently developed:
77
89
78
90
* ``predetermined`` - A number of sensor locations are predetermined and the aim is to optimize the rest.
79
91
92
+
* ``distance constrained`` - Enforces a minimum distance 'r' between selected sensors.
93
+
80
94
.. code-block:: python
81
95
82
96
optimizer_exact = ps.optimizers.GQR()
@@ -89,24 +103,10 @@ Three strategies to deal with constraints are currently developed:
89
103
We have further provided functions to compute the sensors in the constrained regions. For example if the user provides the center and radius of a circular
90
104
constrained region, the constraints in utils compute the constrained sensor indices. Direct constraint plotting capabilities have also been developed.
91
105
92
-
The constrained shapes currently implemented are:
93
-
94
-
* ``Circle``
95
-
96
-
* ``Cylinder``
97
-
98
-
* ``Line``
99
-
100
-
* ``Parabola``
106
+
The constrained shapes currently implemented are: ``Circle``, ``Cylinder``, ``Line``, ``Parabola``, ``Ellipse``, ``Polygon``.
107
+
A user can also define their own constraints using ``UserDefinedConstraints``, this type of constraint has the ability to take in either a function or a .py file which contains a functional definition of the constrained region.
101
108
102
-
* ``Ellipse``
103
-
104
-
* ``Polygon``
105
-
106
-
* ``UserDefinedConstraints``
107
-
108
-
- This type of constraint has the ability to take in either a function from the user or a
109
-
.py file which contains a functional definition of the constrained region.
109
+
See `this example <https://python-sensors.readthedocs.io/en/latest/examples/Olivetti_constrained_sensing.html>`__ for more information.
110
110
111
111
Classification
112
112
^^^^^^^^^^^^^^
@@ -126,7 +126,7 @@ Bases
126
126
^^^^^
127
127
The basis in which measurement data are represented can have a dramatic
128
128
effect on performance. PySensors implements the three bases most commonly
129
-
used for sparse sensor placement: raw measurements, SVD/POD/PCA modes, and random projections. Bases can be easily incorporated into ``SSPOR`` and ``SSPOC`` classes:
129
+
used for sparse sensor placement: raw measurements, SVD/POD/PCA modes, and random projections. A user can also define their own custom basis. Bases can be easily incorporated into ``SSPOR`` and ``SSPOC`` classes:
130
130
131
131
.. code-block:: python
132
132
@@ -141,7 +141,7 @@ Installation
141
141
142
142
Dependencies
143
143
^^^^^^^^^^^^
144
-
The high-level dependencies for PySensors are Linux or macOS and Python 3.6-3.8. ``pip`` is also recommended as is makes managing PySensors' other dependencies much easier. You can install it by following the instructions `here <https://packaging.python.org/tutorials/installing-packages/#ensure-you-can-run-pip-from-the-command-line>`__.
144
+
The high-level dependencies for PySensors are Linux or macOS and Python 3.9-3.12. ``pip`` is also recommended as is makes managing PySensors' other dependencies much easier. You can install it by following the instructions `here <https://packaging.python.org/tutorials/installing-packages/#ensure-you-can-run-pip-from-the-command-line>`__.
145
145
146
146
PySensors has not been tested on Windows.
147
147
@@ -191,10 +191,24 @@ The primary PySensors objects are the ``SSPOR`` and ``SSPOC`` classes, which are
191
191
192
192
- ``Identity`` - use raw measurement data
193
193
- ``SVD`` - efficiently compute first k left singular vectors
194
-
- ``RandomProjection`` - Gaussian random projections of measurements
194
+
- ``RandomProjection`` - gaussian random projections of measurements
195
+
- ``CustomBasis`` - user defined bases ranging from DMD modes to Chebyshev polynomials
195
196
197
+
* ``optimizers`` - submodule implementing different optimizers to fit data
198
+
199
+
- ``QR`` - greedy QR optimizer
200
+
- ``CCQR`` - greedy cost constrained QR optimizer
201
+
- ``GQR`` - general QR optimizer
202
+
- ``TPGR`` - two point greedy optmizer
196
203
* Convenience functions to aid in the analysis of error as number of sensors or basis modes are varied
197
204
205
+
The diagram below outlines a flow chart of how a user can utilize pysensors.
206
+
207
+
.. figure:: docs/figures/pysensors-methods.jpeg
208
+
:align:center
209
+
:alt:A flow chart of pysensors methods.
210
+
:figclass:align-center
211
+
198
212
Documentation
199
213
-------------
200
214
PySensors has a `documentation site <https://python-sensors.readthedocs.io/en/latest/index.html>`__ hosted by readthedocs.
- Karnik, Niharika, Mohammad G. Abdo, Carlos E. Estrada-Perez, Jun Soo Yoo,
304
-
Joshua J. Cogliati, Richard S. Skifton, Pattrick Calderoni, Steven L. Brunton, and Krithika Manohar.
305
-
"Constrained Optimization of Sensor Plcaement for Nuclear Digital Twins" IEEE Sensors Journal 24, no. 9
317
+
- Karnik, Niharika, Mohammad G. Abdo, Carlos E. Estrada-Perez, Jun Soo Yoo, Joshua J. Cogliati, Richard S. Skifton, Pattrick Calderoni, Steven L. Brunton, and Krithika Manohar.
318
+
"Constrained Optimization of Sensor Placement for Nuclear Digital Twins" IEEE Sensors Journal 24, no. 9
This notebook gives an overview of most of the different tools available in `PySensors`. It's a good place to start to get a quick idea of what the package is capable of.
10
+
11
+
.. toctree::
12
+
:hidden:
13
+
:maxdepth:1
14
+
15
+
pysensors_overview
16
+
17
+
`Classification <./classification.ipynb>`__
18
+
-------------------------------------------
19
+
This notebook showcases the use of `SSPOC` class (Sparse Sensor Placement Optimization for Classification) to choose sparse sets of sensors for *classification* problems.
20
+
21
+
.. toctree::
22
+
:hidden:
23
+
:maxdepth:1
24
+
25
+
classification
26
+
27
+
Reconstruction
28
+
--------------
29
+
These notebooks show how the `SSPOR` class (Sparse Sensor Placement Optimization for Reconstruction) can be used with different optimizers.
30
+
The default optimizer for `SSPOR` is `QR`, which uses QR pivoting to select sensors in unconstrained problems.
31
+
`GQR` (General QR) optimizer provides a more intrusive approach into the `QR` pivoting procedure to take into account spatial constraints. The `General QR Optimizer for Spatial Constraints <./spatial_constrained_qr.ipynb>`__ and `Functional Constraints for Olivetti Faces <./Olivetti_constrained_sensing.ipynb>`__ notebooks provide a detailed account of unconstrained and constrained sensor placement.
32
+
`CCQR` (Cost Constrained QR) optimizer can be used to place sparse sensors when there are variable costs associated with different locations. The `Cost Constrained QR <./cost_constrained_qr.ipynb>`__ notebook showcases the `CCQR` optimizer.
33
+
`TPGR` (Two Point GReedy) optimizer uses a thermodynamic approach to sensor placement that maps the complete landscape of sensor interactions induced by the training data and places sensors such that the marginal energy of each next placed sensor is minimized. The `TPGR <./two_point_greedy.ipynb>`__ notebook goes into detail about the optimizer and the one-point and two-point enery landscape computation. The `TPGR` optimizer requires prior and noise.
34
+
35
+
There are two methods used for reconstruction: `Unregularized Reconstruction`, which uses the Moore-Penrose Pseudoinverse method, and `Regularized Reconstruction`, that uses a maximal likelihood reconstructor that requires a prior and noise.
36
+
The `Reconstruction Comparison <./reconstruction_comparison.ipynb>`__ notebook compares these two methods using the `TPGR` optimizer. It also shows a comparison between `TPGR` and `QR` optimizers using both of the reconstruction methods.
37
+
38
+
.. toctree::
39
+
:hidden:
40
+
:maxdepth:1
41
+
42
+
spatial_constrained_qr
43
+
Olivetti_constrained_sensing
44
+
cost_constrained_qr
45
+
two_point_greedy
46
+
reconstruction_comparison
47
+
48
+
Basis
49
+
-----
50
+
The `Basis Comparison <./basis_comparison.ipynb>`__ notebook compares the different basis options implemented in `PySensors` on a simple problem.
51
+
`Cross Validation<./cross_validation.ipynb>`__ is also performed with `scikit-learn` objects to optimize the number of sensors and/or basis modes.
52
+
4
53
.. toctree::
5
-
:maxdepth:1
6
-
:caption:Example Notebooks
7
-
8
-
pysensors_overview
9
-
basis_comparison
10
-
classification
11
-
cost_constrained_qr
12
-
cross_validation
13
-
sea_surface_temperature
14
-
reconstruction_comparison
15
-
two_point_greedy
16
-
polynomial_curve_fitting
17
-
spatial_constrained_qr
18
-
Olivetti_constrained_sensing
19
-
OPTI-TWIST_constrained_sensing
54
+
:hidden:
55
+
:maxdepth:1
56
+
57
+
basis_comparison
58
+
cross_validation
59
+
60
+
Applications
61
+
------------
62
+
These notebooks showcase the sensor placement optimization methods on datasets ranging from `Sea Surface Temperature <./sea_surface_temperature.ipynb>`__ to predicting the temperature within a `Fuel Rod <./OPTI-TWIST_constrained_sensing.ipynb>`__ with spatially constrained sensors.
63
+
The `Polynomial Curve Fitting <./polynomial_curve_fitting>`__ notebook demonstrates how to use PySensors to select sensor locations for polynomial interpolation using the monomial basis $1, x, x^2, x^3, \dots, x^k$.
0 commit comments