Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Affine-parametric Operators, Parametric ROMs #67

Merged
merged 48 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
7fe3c2c
start parametric operator docs
shanemcq18 Aug 13, 2024
4c510b3
nonparametric operator docstring tweaks
shanemcq18 Aug 13, 2024
fec635b
explanation of parametric opinf
shanemcq18 Aug 14, 2024
8e04d28
move entries to ParametricOpInfOperator
shanemcq18 Aug 14, 2024
3461a8b
update models for interpolation changes
shanemcq18 Aug 14, 2024
b660641
first draft of affine operators and API documentation
shanemcq18 Aug 14, 2024
6c4f8e4
affine doc fixes, bug fixes
shanemcq18 Aug 14, 2024
c00468d
fix operators doc sidebar
shanemcq18 Aug 14, 2024
02cd96f
first draft of noninterpolatory parametric models
shanemcq18 Aug 15, 2024
e7604f8
allow sparse matrices for operator entries
shanemcq18 Aug 20, 2024
ea22ea5
start affine tests, late binding warning and fix
shanemcq18 Aug 20, 2024
cabec30
remove entries setter/deleter from parametric operators
shanemcq18 Aug 21, 2024
84ae692
hdf5 scipy.sparse utilities
shanemcq18 Aug 22, 2024
b200b6f
sparse arrays for constant, linear operators
shanemcq18 Aug 22, 2024
fcc86b4
test affine copy()/save()/load()
shanemcq18 Aug 22, 2024
3e5c69c
tests for save/load_sparray()
shanemcq18 Aug 22, 2024
ed57381
tests and fixes for timed_block
shanemcq18 Aug 22, 2024
2c15a6b
affine operators take in single callable, test coverage
shanemcq18 Aug 29, 2024
aa43e69
_AffineOperator.__str__(), doc typo fixes
shanemcq18 Aug 29, 2024
2e99935
[Interpolated -> Interp]Operators big rename
shanemcq18 Aug 29, 2024
4ef277c
OperatorClass -> _OperatorClass, operator utils
shanemcq18 Aug 29, 2024
fc08ffd
remove operator utils from public docs
shanemcq18 Aug 29, 2024
d240694
remove operators.has_inputs() from public, fix tests
shanemcq18 Aug 29, 2024
4ca47ab
[Interpolated -> Interp]DerivativeEstimator, add PchipInterpolator op…
shanemcq18 Aug 29, 2024
315f8c6
test coverage, bug fixes for ParametricModels
shanemcq18 Aug 30, 2024
66eccaa
fix input datasets counting bug
shanemcq18 Aug 30, 2024
54a5ca6
start tests for ROM class
shanemcq18 Aug 12, 2024
b7858a3
initial _BaseROM split
shanemcq18 Aug 30, 2024
9c119fa
v0.5.[7->8], update utils doc page
shanemcq18 Aug 30, 2024
2358eaa
models._utils, ROM test framework
shanemcq18 Aug 30, 2024
2c7bb40
ROM.encode() tests and bug fixes
shanemcq18 Aug 30, 2024
9f94e31
tests and fixes for decode, project
shanemcq18 Sep 4, 2024
ceabbc5
InterpolatedModels -> InterpModels
shanemcq18 Sep 4, 2024
e44ebc8
fix iscontinuous bug
shanemcq18 Sep 4, 2024
e65f0c8
draft ROM.fit(), ParametricROM.fit()
shanemcq18 Sep 5, 2024
159bd28
tests + fixes for [Parametric]ROM.fit(), predict()
shanemcq18 Sep 5, 2024
780f1f9
intersphinx pandas
shanemcq18 Sep 6, 2024
e6f1068
standardize __str__
shanemcq18 Sep 6, 2024
13610a1
update introductory tutorial
shanemcq18 Sep 6, 2024
aada910
timed_block -> TimedBlock, fix Examples doc
shanemcq18 Sep 6, 2024
5fb9bca
heat equation tutorial -> inputs tutorial
shanemcq18 Sep 9, 2024
c7df177
ROM check fit args
shanemcq18 Sep 10, 2024
2cd67e2
finish inputs tutorial
shanemcq18 Sep 10, 2024
87d085b
update changelog
shanemcq18 Sep 10, 2024
fe91999
p = 1 case for affine operators
shanemcq18 Sep 10, 2024
431c1b5
fix doc typos
shanemcq18 Sep 10, 2024
09cc274
draft parametric problems tutorial
shanemcq18 Sep 10, 2024
b6db393
skip TimedBlock tests on Windows
shanemcq18 Sep 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ docs/source/opinf/literature.md
__pycache__/
.ipynb_checkpoints/
.pytest_cache/
.ruff_cache/
htmlcov/
.coverage*
build/
Expand Down Expand Up @@ -52,3 +53,4 @@ html/
# Other
*.swp
.markdownlint.json
Notes/
3 changes: 3 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ sphinx:
sklearn:
- "https://scikit-learn.org/stable/"
- null
pandas:
- "https://pandas.pydata.org/docs/"
- null
mathjax3_config:
tex:
macros:
Expand Down
5 changes: 4 additions & 1 deletion docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ parts:
# numbered: 1
chapters:
- file: source/tutorials/basics.ipynb
- file: source/tutorials/heat_equation.ipynb
- file: source/tutorials/inputs.ipynb
# - file: source/tutorials/lifting.ipynb
# - file: source/tutorials/regularization.ipynb
- file: source/tutorials/parametric.ipynb

# API reference via sphinx-autodoc + limited handwritten documentation.
- caption: API Reference
Expand Down
6 changes: 3 additions & 3 deletions docs/source/api/ddt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
" DerivativeEstimatorTemplate\n",
" UniformFiniteDifferencer\n",
" NonuniformFiniteDifferencer\n",
" InterpolationDerivativeEstimator\n",
" InterpDerivativeEstimator\n",
"\n",
"**Finite Difference Schemes for Uniformly Spaced Data**\n",
"\n",
Expand Down Expand Up @@ -352,7 +352,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The {class}`InterpolationDerivativeEstimator` interpolates the state data using classes from {mod}`scipy.interpolate` and evaluates the derivative of the interpolant."
"The {class}`InterpDerivativeEstimator` interpolates the state data using classes from {mod}`scipy.interpolate` and evaluates the derivative of the interpolant."
]
},
{
Expand All @@ -361,7 +361,7 @@
"metadata": {},
"outputs": [],
"source": [
"estimator = opinf.ddt.InterpolationDerivativeEstimator(t, \"cubic\")\n",
"estimator = opinf.ddt.InterpDerivativeEstimator(t, \"pchip\")\n",
"print(estimator)"
]
},
Expand Down
24 changes: 13 additions & 11 deletions docs/source/api/missing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ddt.ipynb
DerivativeEstimatorTemplate
UniformFiniteDifferencer
NonuniformFiniteDifferencer
InterpolationDerivativeEstimator
InterpDerivativeEstimator
fwd1
fwd2
fwd3
Expand Down Expand Up @@ -107,16 +107,18 @@ operators.ipynb
StateInputOperator
ParametricOperatorTemplate
ParametricOpInfOperator
InterpolatedConstantOperator
InterpolatedLinearOperator
InterpolatedQuadraticOperator
InterpolatedCubicOperator
InterpolatedInputOperator
InterpolatedStateInputOperator
has_inputs
is_nonparametric
is_parametric
is_uncalibrated
AffineConstantOperator
AffineLinearOperator
AffineQuadraticOperator
AffineCubicOperator
AffineInputOperator
AffineStateInputOperator
InterpConstantOperator
InterpLinearOperator
InterpQuadraticOperator
InterpCubicOperator
InterpInputOperator
InterpStateInputOperator

lstsq.ipynb
-----------
Expand Down
62 changes: 46 additions & 16 deletions docs/source/api/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

```{eval-rst}
.. automodule:: opinf.models

.. currentmodule:: opinf.models

**Nonparametric Models**

.. autosummary::
:toctree: _autosummaries
:nosignatures:

ContinuousModel
DiscreteModel

**Parametric Models**

.. autosummary::
:toctree: _autosummaries
:nosignatures:

ParametricContinuousModel
ParametricDiscreteModel
InterpContinuousModel
InterpDiscreteModel
```

:::{admonition} Overview
Expand Down Expand Up @@ -55,7 +77,6 @@ A _nonparametric_ model is comprised exclusively of [nonparametric operators](se
.. currentmodule:: opinf.models

.. autosummary::
:toctree: _autosummaries
:nosignatures:

ContinuousModel
Expand Down Expand Up @@ -123,46 +144,55 @@ A _parametric model_ is a model with at least one [parametric operator](sec-oper
Parametric models are similar to nonparametric models: they are initialized with a list of operators, use `fit()` to calibrate operator entries, and `predict()` to solve the model.
In addition, parametric models have an `evaluate()` method that returns a nonparametric model at a fixed parameter value.

### Interpolated Models
```{eval-rst}
.. currentmodule:: opinf.models

.. autosummary::
:nosignatures:

ParametricContinuousModel
ParametricDiscreteModel
```

### Interpolatory Models

Interpolated models consist exclusively of [interpolated operators](sec-operators-interpolated).
Interpolatory models consist exclusively of [interpolatory operators](sec-operators-interpolated).

```{eval-rst}
.. currentmodule:: opinf.models

.. autosummary::
:toctree: _autosummaries
:nosignatures:

InterpolatedContinuousModel
InterpolatedDiscreteModel
InterpContinuousModel
InterpDiscreteModel
```

:::{tip}
The `operators` constructor argument for these classes can also be a string that indicates which type of operator to use.

| Character | {mod}`opinf.operators` class |
| :-------- | :------------------------------- |
| `'c'` | {class}`opinf.operators.InterpolatedConstantOperator` |
| `'A'` | {class}`opinf.operators.InterpolatedLinearOperator` |
| `'H'` | {class}`opinf.operators.InterpolatedQuadraticOperator` |
| `'G'` | {class}`opinf.operators.InterpolatedCubicOperator` |
| `'B'` | {class}`opinf.operators.InterpolatedInputOperator` |
| `'N'` | {class}`opinf.operators.InterpolatedStateInputOperator` |
| `'c'` | {class}`opinf.operators.InterpConstantOperator` |
| `'A'` | {class}`opinf.operators.InterpLinearOperator` |
| `'H'` | {class}`opinf.operators.InterpQuadraticOperator` |
| `'G'` | {class}`opinf.operators.InterpCubicOperator` |
| `'B'` | {class}`opinf.operators.InterpInputOperator` |
| `'N'` | {class}`opinf.operators.InterpStateInputOperator` |

```python
import opinf

# Initialize the model with a list of operator objects.
model = opinf.models.InterpolatedContinuousModel(
model = opinf.models.InterpContinuousModel(
operators=[
opinf.operators.InterpolatedCubicOperator(),
opinf.operators.InterpolatedStateInputOperator(),
opinf.operators.InterpCubicOperator(),
opinf.operators.InterpStateInputOperator(),
]
)

# Equivalently, initialize the model with a string.
model = opinf.models.InterpolatedContinuousModel(operators="GN")
model = opinf.models.InterpContinuousModel(operators="GN")
```

:::
Expand Down
Loading