What’s New#
Attention
opinf
is a research code that is still in rapid development.
New versions may introduce substantial new features or API adjustments.
Version 0.5.11#
New scaling option for
pre.ShiftScaleTransformer
so that training snapshots have at maximum norm 1. Contributed by @nicolearetz.Small clarifications to
pre.ShiftScaleTransformer
and updates to thepre
documentation.
Version 0.5.10#
New POD basis solver option basis.PODBasis(solver="method-of-snapshots")
(or solver="eigh"
), which solves a symmetric eigenvalue problem instead of computing a (weighted) SVD. This method is more efficient than the SVD for snapshot matrices \(\mathbf{Q}\in\mathbb{R}^{n\times k}\) where \(n \gg k\) and is significantly more efficient than the SVD when a non-diagonal weight matrix is provided.
Contributed by @nicolearetz.
Version 0.5.9#
Automatic regularization selection:
New methods
fit_regselect_continuous()
andfit_regselect_discrete()
in theROM
andParametricROM
classes.utils.gridsearch()
implements grid search followed up by derivative-free log-scale optimization.Class method
TikhonovSolver.get_operator_regularizer()
to construct diagonal Tikhonov regularizers where each operator is regularized by a different scalar.
New transformers for custom shifting / scaling:
pre.ShiftTransformer
pre.ScaleTransformer
pre.NullTransformer
pre.TransformerPipeline
Small improvements:
Executing individual test files now runs the tests contained within.
utils.TimedBlock
has arebuffer
attribute that, when set toTrue
, prevents printing until the end of the block.Improved test coverage, fixed some documentation typos, etc.
Version 0.5.8#
Support for affine-parametric problems:
Affine-parametric operator classes
AffineConstantOperator
,AffineLinearOperator
, etc.Parametric model classes
ParametricContinuousModel
,ParametricDiscreteModel
.ParametricROM
class.Updates to operator / model documentation.
Renamed interpolatory operators / model classes from Interpolated<Name>
to Interp<Name>
.
Old names are deprecated but not yet removed.
Miscellaneous:
Reorganized and expanded tutorials.
Added and documented
opinf.utils.TimedBlock
context manager for quick timing of code blocks.Updated structure for some unit tests.
Refactored interpolatory operators.
Standardized string representations, added
[Parametric]ROM.__str__()
.Removed some public functions from
operators
, regrouped inoperators._utils
.Removed some public functions from
models
, regrouped inmodels._utils
.
Version 0.5.7#
Updates to opinf.lstsq
:
New
TruncatedSVDSolver
class.predict()
has been renamedsolve()
foropinf.lstsq
solver classes to not clash withpredict()
fromopinf.roms
/opinf.models
classes.solve()
always returns a two-dimensional array, even if \(r = 1\).
Various small improvements to tests and documentation.
Version 0.5.6#
Added public templates to opinf.operators
:
OperatorTemplate
for general nonparametric operators.OpInfOperator
for nonparametric operators that can be learned through Operator Inference (operator matrix times data vector structure).ParametricOperatorTemplate
for general parametric operators.ParametricOpInfOperator
for parametric operators that can be learned through Operator Inference.
Also added a new opinf.ddt.InterpolationDerivativeEstimator
class and made various small changes for compatibility with NumPy 2.0.0.
Version 0.5.5#
Changes to the opinf.lstsq
API and improvements to the documentation.
opinf.model
classes now receive solvers in the constructor, not in fit(). This change will be useful for future models that require specific solvers. UpdatedROM
class and tutorials accordingly.New
SolverTemplate
class and inheritance guide for creating new solvers.Renamed attributes to match OpInf terminology.
A --> data_matrix
, called \(\D\) in the docs.B --> lhs_matrix
, called \(\Z\) in the docs. Warning:fit()
receives \(\Z\), not \(\Z\trp\)!\(X\) is replaced with \(\Ohat\). Warning:
predict()
returns \(\Ohat\), not \(\Ohat\trp\)!
Renamed two Tikhonov solver classes:
L2SolverDecoupled --> L2DecoupledSolver
TikhonovSolverDecoupled --> TikhonovDecoupledSolver
Tikhonov solvers no longer have a default regularization value of zero.
Before:
>>> model = opinf.models.ContinuousModel("A")
>>> solver = opinf.lstsq.L2Solver(regularizer=1e-2)
>>> model.fit(states, ddts, inputs, solver=solver)
After:
>>> solver = opinf.lstsq.L2Solver(regularizer=1e-2)
>>> model = opinf.models.ContinuousModel("A", solver=solver)
>>> model.fit(states, ddts, inputs)
Version 0.5.4#
New opinf.roms
submodule containing an opinf.roms.ROM
class, also available in the main namespace as opinf.ROM
.
This class wraps a lifter, transformer, basis, time derivative estimator, model, and least-squares solver together for convenience.
Rewrote the first tutorial to use opinf.ROM
.
Version 0.5.3#
Expanded the ddt
submodule (but no API changes to existing functions).
New backward, central, and forward difference schemes up to sixth order.
New
DerivativeEstimatorTemplate
class for implementing custom derivative estimation strategies.New
UniformFiniteDifference
andNonuniformFiniteDifference
convenience classes for working withROM
classes in the future.Better documentation of the module.
The documentation was also updated to JupyterBook 1.0.0, a significant improvement to the look and feel.
Tests are now managed with tox
, the contributor instructions were updated.
Version 0.5.2#
Significant updates to the pre
and basis
submodules.
Updates to pre
:
New
TransformerTemplate
class for defining custom transformers.Renamed
SnapshotTransformer
toShiftScaleTransformer
.Removed
SnapshotTransformerMulti
.New
TransformerMulti
class for joining multiple transformations.Renamed some attributes of the transformer classes:
n
->full_state_dimension
,ni
->variable_size
, etc.
Updates to basis
:
New
BasisTemplate
class for defining custom bases.Standardized arguments of
fit()
to always be the snapshots. Hyperparameters must come in the constructor.LinearBasis
now accepts an optional weight matrix.LinearBasis
raises a warning if the basis entries are not orthogonal (w.r.t. the weights).Updated
PODBasis
dimensionality properties. Useset_dimension()
to update the reduced state dimension on the fly.Removed
PODBasisMulti
.New
BasisMulti
multi class for joining multiple bases.Renamed some attributes of the basis classes (matching transformer syntax):
n
->full_state_dimension
,r
->reduced_state_dimension
, etc.
Added a new Literature page to the documentation listing Operator Inference publications.
Version 0.5.1#
New lift
module that defines a template class for implementing lifting transformations.
Version 0.5.0#
Overhauled the
operators
module so that each operator class is responsible for its portion of the Operator Inference data matrix.New
StateInputOperator
for state-input bilinear interactions, \(\Nhat[\u\otimes\qhat]\).Operator classes now have
state_dimension
andinput_dimension
properties.Operator classes must implement
datablock()
andoperator_dimension()
methods to facilitate operator inference.
Renamed
roms
tomodels
and updated class names:ContinuousOpInfROM
toContinuousModel
DiscreteOpInfROM
toDiscreteModel
SteadyOpInfROM
toSteadyModel
Same for interpolated models.
Model classes now take a list of operators in the constructor. String shortcuts such as
"cAH"
are still valid, similar to the previousmodelform
argument. Theknown_operators
argument has been removed from thefit()
method.Model classes no longer have a
basis
attribute.The
basis
argument has been removed from thefit()
method.The
compress()
anddecompress()
methods have been removed from model classes.The dimensions
n
andr
have been replaced withstate_dimension
;m
is nowinput_dimension
.
Moved time derivative estimation tools to the new
ddt
submodule.Moved Kronecker product utilities to static methods of nonparametric operators.
utils.kron2c()
is nowQuadraticOperator.ckron()
utils.kron2c_indices()
is nowQuadraticOperator.ckron_indices()
utils.compress_quadratic()
is nowQuadraticOperator.compress_entries()
utils.expand_quadratic()
is nowQuadraticOperator.expand_entries()
utils.kron3c()
is nowCubicOperator.ckron()
utils.kron3c_indices()
is nowCubicOperator.ckron_indices()
utils.compress_cubic()
is nowCubicOperator.compress_entries()
utils.expand_cubic()
is nowCubicOperator.expand_entries()
Version 0.4.5#
Moved basis classes and dimensionality reduction tools to a new
basis
submodule.Moved operator classes from
core.operators
to a newoperators
submodule.Renamed the
core
submodule toroms
.Moved time derivative estimation tools to the
utils
module.
Version 0.4.4#
Fixed a bug in
SnapshotTransformer.load()
that treated thecentered_
attribute incorrectly.Removed the
transformer
attribute from basis classes.Renamed
encode()
tocompress()
anddecode()
todecompress()
.
Version 0.4.2#
In the
fit()
method in ROM classes, replaced theregularizer
argument with asolver
keyword argument. The user should pass in an instantiation of a least-squares solver class from thelstsq
submodule.Hyperparameters for least-squares solver classes in the
lstsq
submodule are now passed to the constructor;predict()
must not take any arguments.Renamed the following least-squares solver classes in the
lstsq
submodule:SolverL2
->L2Solver
SolverL2Decoupled
->L2SolverDecoupled
SolverTikhonov
->TikhonovSolver
SolverTikhonovDecoupled
->TikhonovSolverDecoupled
Before:
>>> rom.fit(basis, states, ddts, inputs, regularizer=1e-2)
After:
>>> solver = opinf.lstsq.L2Solver(regularizer=1e-2)
>>> rom.fit(basis, states, ddts, inputs, solver=solver)
# The L2 solver is also the default if a float is given:
>>> rom.fit(basis, states, ddts, inputs, solver=1e-2)
Versions 0.4.0 and 0.4.1#
This version is a migration of the old rom_operator_inference
package, version 1.4.1.
See this page for the documentation.